[OLINGO-659] Added more javadocs

This commit is contained in:
Michael Bolz 2015-09-10 15:29:51 +02:00
parent 649614b076
commit 9ffe4c8928
71 changed files with 1789 additions and 220 deletions

View File

@ -202,7 +202,7 @@ public class ClientCsdlEdmProvider extends CsdlAbstractEdmProvider {
}
@Override
public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException {
public CsdlAnnotatable getAnnotatable(FullQualifiedName annotatedName) throws ODataException {
final CsdlSchema schema = xmlSchemas.get(annotatedName.getNamespace());
if (schema != null) {
return schema.getAnnotatables().get(annotatedName.getName());

View File

@ -56,7 +56,7 @@ public interface Edm {
* <br/>
* See {@link EdmEntityContainer} for more information.
*
* @param name
* @param name full qualified name of entity container
* @return {@link EdmEntityContainer}
*/
EdmEntityContainer getEntityContainer(FullQualifiedName name);
@ -66,7 +66,7 @@ public interface Edm {
* <br/>
* See {@link EdmEnumType} for more information
*
* @param name
* @param name full qualified name of enum type
* @return {@link EdmEnumType}
*/
EdmEnumType getEnumType(FullQualifiedName name);
@ -76,7 +76,7 @@ public interface Edm {
* <br/>
* See {@link EdmTypeDefinition} for more information
*
* @param name
* @param name full qualified name of type definition
* @return {@link EdmTypeDefinition}
*/
EdmTypeDefinition getTypeDefinition(FullQualifiedName name);
@ -86,7 +86,7 @@ public interface Edm {
* <br/>
* See {@link EdmEntityType} for more information.
*
* @param name
* @param name full qualified name of entity type
* @return {@link EdmEntityType}
*/
EdmEntityType getEntityType(FullQualifiedName name);
@ -96,7 +96,7 @@ public interface Edm {
* <br/>
* See {@link EdmComplexType} for more information.
*
* @param name
* @param name full qualified name of complex type
* @return {@link EdmComplexType}
*/
EdmComplexType getComplexType(FullQualifiedName name);

View File

@ -25,7 +25,16 @@ import java.util.List;
*/
public interface EdmAnnotatable {
/**
* @param term term for annotation
* @return annotation according to term
*/
EdmAnnotation getAnnotation(EdmTerm term);
/**
* Get list of all annotations.
*
* @return list of all annotations
*/
List<EdmAnnotation> getAnnotations();
}

View File

@ -29,7 +29,7 @@ public interface EdmBindingTarget extends EdmNamed, EdmAnnotationsTarget, EdmAnn
/**
* Returns the target for a given path.
*
* @param path
* @param path path for which the target is returned
* @return {@link EdmBindingTarget}
*/
EdmBindingTarget getRelatedBindingTarget(String path);

View File

@ -41,7 +41,7 @@ public interface EdmEntityContainer extends EdmNamed, EdmAnnotationsTarget, EdmA
/**
* Get contained Singleton by name.
*
* @param name
* @param name name of contained Singleton
* @return {@link EdmSingleton}
*/
EdmSingleton getSingleton(String name);
@ -49,7 +49,7 @@ public interface EdmEntityContainer extends EdmNamed, EdmAnnotationsTarget, EdmA
/**
* Get contained EntitySet by name.
*
* @param name
* @param name name of contained EntitySet
* @return {@link EdmEntitySet}
*/
EdmEntitySet getEntitySet(String name);
@ -57,7 +57,7 @@ public interface EdmEntityContainer extends EdmNamed, EdmAnnotationsTarget, EdmA
/**
* Get contained ActionImport by name.
*
* @param name
* @param name name of contained ActionImport
* @return {@link EdmActionImport}
*/
EdmActionImport getActionImport(String name);
@ -65,7 +65,7 @@ public interface EdmEntityContainer extends EdmNamed, EdmAnnotationsTarget, EdmA
/**
* Get contained FunctionImport by name.
*
* @param name
* @param name name of contained FunctionImport
* @return {@link EdmFunctionImport}
*/
EdmFunctionImport getFunctionImport(String name);

View File

@ -42,7 +42,7 @@ public interface EdmEntityType extends EdmStructuredType {
/**
* Get a key property ref by its name.
*
* @param keyPredicateName
* @param keyPredicateName name of key property
* @return {@link EdmKeyPropertyRef} for given name
*/
EdmKeyPropertyRef getKeyPropertyRef(String keyPredicateName);

View File

@ -26,7 +26,9 @@ import java.util.List;
public interface EdmEnumType extends EdmPrimitiveType, EdmAnnotationsTarget {
/**
* @param name
* Get member according to given name
*
* @param name name of member
* @return {@link EdmMember} for the given name
*/
EdmMember getMember(String name);

View File

@ -46,7 +46,9 @@ public interface EdmNavigationProperty extends EdmElement, EdmAnnotationsTarget,
EdmNavigationProperty getPartner();
/**
* @param referencedPropertyName
* Get property name for referenced property
*
* @param referencedPropertyName name of referenced property
* @return propertyName for this referenced property
*/
String getReferencingPropertyName(String referencedPropertyName);

View File

@ -26,7 +26,8 @@ import java.util.List;
public interface EdmOperation extends EdmType, EdmAnnotatable {
/**
* @param name
* Get parameter for given name
* @param name name of parameter
* @return {@link EdmParameter} for this name
*/
EdmParameter getParameter(String name);
@ -39,7 +40,9 @@ public interface EdmOperation extends EdmType, EdmAnnotatable {
List<String> getParameterNames();
/**
* @param bindingParameterEntitySet
* Get EdmEntitySet for the given binding parameters EntitySet
*
* @param bindingParameterEntitySet EntitySet of binding parameter
* @return {@link EdmEntitySet} for this binding
*/
EdmEntitySet getReturnedEntitySet(EdmEntitySet bindingParameterEntitySet);

View File

@ -30,7 +30,7 @@ public interface EdmStructuredType extends EdmType, EdmAnnotationsTarget, EdmAnn
/**
* Get property by name
*
* @param name
* @param name name of property
* @return simple, complex or navigation property as {@link EdmTyped}
*/
EdmElement getProperty(String name);
@ -45,7 +45,7 @@ public interface EdmStructuredType extends EdmType, EdmAnnotationsTarget, EdmAnn
/**
* Get structural property by name.
*
* @param name
* @param name name of structural property
* @return simple or complex property as {@link EdmTyped}
*/
EdmProperty getStructuralProperty(String name);
@ -53,7 +53,7 @@ public interface EdmStructuredType extends EdmType, EdmAnnotationsTarget, EdmAnn
/**
* Get navigation property by name.
*
* @param name
* @param name name of navigation property
* @return navigation property as {@link EdmTyped}
*/
EdmNavigationProperty getNavigationProperty(String name);
@ -75,7 +75,7 @@ public interface EdmStructuredType extends EdmType, EdmAnnotationsTarget, EdmAnn
/**
* Checks if this type is convertible to parameter {@code targetType}
*
* @param targetType
* @param targetType target type for which compatibility is checked
* @return true if this type is compatible to the testType (i.e., this type is a subtype of targetType)
*/
boolean compatibleTo(EdmType targetType);

View File

@ -34,8 +34,9 @@ public final class FullQualifiedName implements Serializable {
private final String fqn;
/**
* @param namespace
* @param name
* Create the FQN with given namespace and name
* @param namespace namespace of FQN
* @param name name of FQN
*/
public FullQualifiedName(final String namespace, final String name) {
this.namespace = namespace;
@ -44,7 +45,8 @@ public final class FullQualifiedName implements Serializable {
}
/**
* @param namespaceAndName
* Create the FQN with given namespace and name (which is split of last <code>.</code> of the parameter).
* @param namespaceAndName namespace and name of FQN
*/
public FullQualifiedName(final String namespaceAndName) {
final int dotIdx = namespaceAndName.lastIndexOf('.');

View File

@ -64,23 +64,29 @@ public enum ODataServiceVersion {
}
/**
* actual > comparedTo
* Check if <code>firstValue</code> is bigger then <code>secondValue</code>
*
* @param actual
* @param comparedTo
* @return <code>true</code> if actual is bigger than comparedTo
* @param firstValue first value which is compared
* @param secondValue second value which is compared
* @return <code>true</code> if firstValue is bigger than secondValue
*/
public static boolean isBiggerThan(final String actual, final String comparedTo) {
if (!validateDataServiceVersion(comparedTo) || !validateDataServiceVersion(actual)) {
throw new IllegalArgumentException("Illegal arguments: " + comparedTo + " and " + actual);
public static boolean isBiggerThan(final String firstValue, final String secondValue) {
if (!validateDataServiceVersion(secondValue) || !validateDataServiceVersion(firstValue)) {
throw new IllegalArgumentException("Illegal arguments: " + secondValue + " and " + firstValue);
}
final double me = Double.parseDouble(extractDataServiceVersionString(actual));
final double other = Double.parseDouble(extractDataServiceVersionString(comparedTo));
final double me = Double.parseDouble(extractDataServiceVersionString(firstValue));
final double other = Double.parseDouble(extractDataServiceVersionString(secondValue));
return me > other;
}
/**
* Extract data service version and return it.
*
* @param rawDataServiceVersion raw data service version from which the service version gets extracted
* @return the extracted data service version
*/
private static String extractDataServiceVersionString(final String rawDataServiceVersion) {
if (rawDataServiceVersion != null) {
final String[] pattern = rawDataServiceVersion.split(";");

View File

@ -35,11 +35,25 @@ public abstract class CsdlAbstractEdmItem implements Serializable {
private static final long serialVersionUID = 241190986363884784L;
/**
* Gets one by name.
*
* @param name the name
* @param items the items
* @return the one by name
*/
protected <T extends CsdlNamed> T getOneByName(final String name, final Collection<T> items) {
final List<T> result = getAllByName(name, items);
return result.isEmpty() ? null : result.get(0);
}
/**
* Gets all by name.
*
* @param name the name
* @param items the items
* @return the all by name
*/
protected <T extends CsdlNamed> List<T> getAllByName(final String name, final Collection<T> items) {
final List<T> result = new ArrayList<T>();
for (T type : items) {

View File

@ -114,7 +114,7 @@ public abstract class CsdlAbstractEdmProvider implements CsdlEdmProvider {
}
@Override
public CsdlAnnotatable getAnnoatatable(final FullQualifiedName annotatedName) throws ODataException {
public CsdlAnnotatable getAnnotatable(final FullQualifiedName annotatedName) throws ODataException {
return null;
}
}

View File

@ -51,6 +51,7 @@ public class CsdlAction extends CsdlOperation {
return this;
}
@Override
public CsdlAction setReturnType(final CsdlReturnType returnType) {
this.returnType = returnType;

View File

@ -40,7 +40,7 @@ public class CsdlActionImport extends CsdlOperationImport {
this.entitySet = entitySet;
return this;
}
/**
* Returns the full qualified name of the action as string
* @return full qualified name
@ -48,7 +48,7 @@ public class CsdlActionImport extends CsdlOperationImport {
public String getAction() {
return action.getFullQualifiedNameAsString();
}
/**
* Returns the full qualified name of the action
* @return full qualified name
@ -56,7 +56,7 @@ public class CsdlActionImport extends CsdlOperationImport {
public FullQualifiedName getActionFQN() {
return action;
}
/**
* Sets the full qualified name of the action as string
* @param action full qualified name

View File

@ -37,22 +37,22 @@ public class CsdlAliasInfo {
/**
* Sets the namespace of the alias
* @param namespace
* @param namespace the namespace of the alias
* @return this instance
*/
public CsdlAliasInfo setNamespace(final String namespace) {
this.namespace = namespace;
return this;
}
/**
* Returns the alias of item
* @return Alias
* @return Alias alias
*/
public String getAlias() {
return alias;
}
/**
* Sets the alias of the item
* @param alias Alias

View File

@ -24,7 +24,7 @@ import java.util.List;
* Super type of all annotatable CSDL items
*/
public interface CsdlAnnotatable {
/**
* Returns a list of annotations
* @return list of annotations

View File

@ -37,7 +37,7 @@ public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatab
private List<CsdlAnnotation> annotation = new ArrayList<CsdlAnnotation>();
private AnnotationExpression annotationExpression;
/**
* Returns the annotated expression
* @return expression annotated expression
@ -45,23 +45,23 @@ public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatab
public AnnotationExpression getExpression() {
return annotationExpression;
}
/**
* Sets the annotated expression
* @param annotationExpression annotated expression
* @param annotationExpression annotated expression
*/
public void setExpression(final AnnotationExpression annotationExpression) {
this.annotationExpression = annotationExpression;
}
/**
* Returns the annotated term
* @return Term
* @return Term term
*/
public String getTerm() {
return term;
}
/**
* Sets the annotated expression
* @param term term
@ -71,7 +71,7 @@ public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatab
this.term = term;
return this;
}
/**
* Returns the annotated qualifier
* @return annotated qualifier
@ -79,7 +79,7 @@ public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatab
public String getQualifier() {
return qualifier;
}
/**
* Sets the annotated qualifier
* @param qualifier annotated qualifier
@ -89,7 +89,7 @@ public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatab
this.qualifier = qualifier;
return this;
}
/**
* Sets a list of annotations
* @param annotation list of annotations

View File

@ -21,6 +21,9 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.ArrayList;
import java.util.List;
/**
* The type Csdl annotations.
*/
public class CsdlAnnotations extends CsdlAbstractEdmItem implements CsdlAnnotatable {
private static final long serialVersionUID = 8283036066408166150L;
@ -31,19 +34,41 @@ public class CsdlAnnotations extends CsdlAbstractEdmItem implements CsdlAnnotata
private String qualifier;
/**
* Gets target.
*
* @return the target
*/
public String getTarget() {
return target;
}
/**
* Sets target.
*
* @param target the target
* @return the target
*/
public CsdlAnnotations setTarget(final String target) {
this.target = target;
return this;
}
/**
* Gets qualifier.
*
* @return the qualifier
*/
public String getQualifier() {
return qualifier;
}
/**
* Sets qualifier.
*
* @param qualifier the qualifier
* @return the qualifier
*/
public CsdlAnnotations setQualifier(final String qualifier) {
this.qualifier = qualifier;
return this;
@ -54,6 +79,12 @@ public class CsdlAnnotations extends CsdlAbstractEdmItem implements CsdlAnnotata
return annotations;
}
/**
* Gets annotation.
*
* @param term the term
* @return the annotation
*/
public CsdlAnnotation getAnnotation(final String term) {
CsdlAnnotation result = null;
for (CsdlAnnotation annotation : getAnnotations()) {

View File

@ -23,14 +23,26 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl binding target.
*/
public abstract class CsdlBindingTarget extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -7011724617956042182L;
/**
* The Name.
*/
protected String name;
/**
* The Type.
*/
protected FullQualifiedName type;
/**
* The Navigation property bindings.
*/
protected List<CsdlNavigationPropertyBinding> navigationPropertyBindings =
new ArrayList<CsdlNavigationPropertyBinding>();
@ -41,33 +53,72 @@ public abstract class CsdlBindingTarget extends CsdlAbstractEdmItem implements C
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlBindingTarget setName(final String name) {
this.name = name;
return this;
}
/**
* Gets type.
*
* @return the type
*/
public String getType() {
return type.getFullQualifiedNameAsString();
}
/**
* Gets type fQN.
*
* @return the type fQN
*/
public FullQualifiedName getTypeFQN() {
return type;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlBindingTarget setType(final String type) {
this.type = new FullQualifiedName(type);
return this;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlBindingTarget setType(final FullQualifiedName type) {
this.type = type;
return this;
}
/**
* Gets navigation property bindings.
*
* @return the navigation property bindings
*/
public List<CsdlNavigationPropertyBinding> getNavigationPropertyBindings() {
return navigationPropertyBindings;
}
/**
* Sets navigation property bindings.
*
* @param navigationPropertyBindings the navigation property bindings
* @return the navigation property bindings
*/
public CsdlBindingTarget setNavigationPropertyBindings(
final List<CsdlNavigationPropertyBinding> navigationPropertyBindings) {
this.navigationPropertyBindings = navigationPropertyBindings;

View File

@ -22,6 +22,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl complex type.
*/
public class CsdlComplexType extends CsdlStructuralType {
private static final long serialVersionUID = 1089771609327713928L;

View File

@ -23,157 +23,169 @@ import java.util.List;
import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
public interface CsdlEdmProvider {
/**
* The interface Csdl edm provider.
*/
interface CsdlEdmProvider {
/**
* This method should return an {@link CsdlEnumType} or <b>null</b> if nothing is found
*
* @param enumTypeName
* @return {@link CsdlEnumType} for given name
* @throws ODataException
* @param enumTypeName full qualified name of enum type
* @return for given name
* @throws ODataException the o data exception
*/
public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException;
CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException;
/**
* This method should return an {@link CsdlTypeDefinition} or <b>null</b> if nothing is found
*
* @param typeDefinitionName
* @return {@link CsdlTypeDefinition} for given name
* @throws ODataException
* @param typeDefinitionName full qualified name of type definition
* @return for given name
* @throws ODataException the o data exception
*/
public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException;
CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException;
/**
* This method should return an {@link CsdlEntityType} or <b>null</b> if nothing is found
*
* @param entityTypeName
* @return {@link CsdlEntityType} for the given name
* @throws ODataException
* @param entityTypeName full qualified name of entity type
* @return for the given name
* @throws ODataException the o data exception
*/
public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException;
CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException;
/**
* This method should return a {@link CsdlComplexType} or <b>null</b> if nothing is found.
*
* @param complexTypeName
* @return {@link CsdlComplexType} for the given name
* @throws ODataException
* @param complexTypeName full qualified name of complex type
* @return for the given name
* @throws ODataException the o data exception
*/
public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException;
CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException;
/**
* This method should return a list of all {@link CsdlAction} for the FullQualifiedname
* or <b>null</b> if nothing is found
*
* @param actionName
* @return List of {@link CsdlAction} or null
* @throws ODataException
* @param actionName full qualified name of action
* @return List of
* or null
* @throws ODataException the o data exception
*/
public List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException;
List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException;
/**
* This method should return a list of all {@link CsdlFunction} for the FullQualifiedname or <b>null</b> if nothing is
* found
*
* @param functionName
* @return List of {@link CsdlFunction} or null
* @throws ODataException
* @param functionName full qualified name of function
* @return List of
* or null
* @throws ODataException the o data exception
*/
public List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException;
List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException;
/**
* This method should return a {@link CsdlTerm} for the FullQualifiedName or <b>null</b> if nothing is found.
* @param termName the name of the Term
* @return {@link CsdlTerm} or null
* @throws ODataException
* @return or null
* @throws ODataException the o data exception
*/
public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException;
CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException;
/**
* This method should return an {@link CsdlEntitySet} or <b>null</b> if nothing is found
*
* @param entityContainer this EntitySet is contained in
* @param entitySetName
* @return {@link CsdlEntitySet} for the given container and entityset name
* @throws ODataException
* @param entitySetName name of entity set
* @return for the given container and entityset name
* @throws ODataException the o data exception
*/
public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
throws ODataException;
/**
* This method should return an {@link CsdlSingleton} or <b>null</b> if nothing is found
*
* @param entityContainer this Singleton is contained in
* @param singletonName
* @return {@link CsdlSingleton} for given container and singleton name
* @throws ODataException
* @param singletonName name of singleton
* @return for given container and singleton name
* @throws ODataException the o data exception
*/
public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
throws ODataException;
/**
* This method should return an {@link CsdlActionImport} or <b>null</b> if nothing is found
*
* @param entityContainer this ActionImport is contained in
* @param actionImportName
* @return {@link CsdlActionImport} for the given container and ActionImport name
* @throws ODataException
* @param actionImportName name of action import
* @return for the given container and ActionImport name
* @throws ODataException the o data exception
*/
public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
throws ODataException;
/**
* This method should return a {@link CsdlFunctionImport} or <b>null</b> if nothing is found
*
* @param entityContainer this FunctionImport is contained in
* @param functionImportName
* @return {@link CsdlFunctionImport} for the given container name and function import name
* @throws ODataException
* @param functionImportName name of function import
* @return for the given container name and function import name
* @throws ODataException the o data exception
*/
public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
throws ODataException;
/**
* This method should return an {@link CsdlEntityContainerInfo} or <b>null</b> if nothing is found
*
* @param entityContainerName (null for default container)
* @return {@link CsdlEntityContainerInfo} for the given name
* @throws ODataException
* @return for the given name
* @throws ODataException the o data exception
*/
public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName)
CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName)
throws ODataException;
/**
* This method should return a list of all namespaces which have an alias
*
* @return List of alias info
* @throws ODataException
* @throws ODataException the o data exception
*/
public List<CsdlAliasInfo> getAliasInfos() throws ODataException;
List<CsdlAliasInfo> getAliasInfos() throws ODataException;
/**
* This method should return a collection of all {@link CsdlSchema}
*
* @return List<{@link CsdlSchema}>
* @throws ODataException
* @return List of
* @throws ODataException the o data exception
*/
public List<CsdlSchema> getSchemas() throws ODataException;
List<CsdlSchema> getSchemas() throws ODataException;
/**
* Returns the entity container of this edm
* @return {@link CsdlEntityContainer} of this edm
* @return of this edm
* @throws ODataException the o data exception
*/
public CsdlEntityContainer getEntityContainer() throws ODataException;
CsdlEntityContainer getEntityContainer() throws ODataException;
/**
* @param targetName
* @return {@link CsdlAnnotations} group for the given Target
* Gets annotations group.
*
* @param targetName full qualified name of target
* @return group for the given Target
* @throws ODataException the o data exception
*/
public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException;
CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException;
/**
* @param annotatedName
* @return Annotatble element by target name
* Gets annotatable.
*
* @param annotatedName full qualified name of annotatable
* @return Annotatable element by target name
* @throws ODataException the o data exception
*/
public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException;
CsdlAnnotatable getAnnotatable(FullQualifiedName annotatedName) throws ODataException;
}

View File

@ -23,6 +23,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl entity container.
*/
public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = 5384682515007129458L;
@ -47,11 +50,22 @@ public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlName
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlEntityContainer setName(final String name) {
this.name = name;
return this;
}
/**
* Gets extends container.
*
* @return the extends container
*/
public String getExtendsContainer() {
if (extendsContainer != null) {
return extendsContainer.getFullQualifiedNameAsString();
@ -59,28 +73,61 @@ public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlName
return null;
}
/**
* Gets extends container fQN.
*
* @return the extends container fQN
*/
public FullQualifiedName getExtendsContainerFQN() {
return extendsContainer;
}
/**
* Sets extends container.
*
* @param extendsContainer the extends container
* @return the extends container
*/
public CsdlEntityContainer setExtendsContainer(final String extendsContainer) {
this.extendsContainer = new FullQualifiedName(extendsContainer);
return this;
}
/**
* Gets entity sets.
*
* @return the entity sets
*/
public List<CsdlEntitySet> getEntitySets() {
return entitySets;
}
/**
* Gets entity set.
*
* @param name the name
* @return the entity set
*/
public CsdlEntitySet getEntitySet(final String name) {
return getOneByName(name, getEntitySets());
}
/**
* Sets entity sets.
*
* @param entitySets the entity sets
* @return the entity sets
*/
public CsdlEntityContainer setEntitySets(final List<CsdlEntitySet> entitySets) {
this.entitySets = entitySets;
return this;
}
/**
* Gets action imports.
*
* @return the action imports
*/
public List<CsdlActionImport> getActionImports() {
return actionImports;
}
@ -105,11 +152,22 @@ public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlName
return getAllByName(name, getActionImports());
}
/**
* Sets action imports.
*
* @param actionImports the action imports
* @return the action imports
*/
public CsdlEntityContainer setActionImports(final List<CsdlActionImport> actionImports) {
this.actionImports = actionImports;
return this;
}
/**
* Gets function imports.
*
* @return the function imports
*/
public List<CsdlFunctionImport> getFunctionImports() {
return functionImports;
}
@ -134,19 +192,42 @@ public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlName
return getAllByName(name, getFunctionImports());
}
/**
* Sets function imports.
*
* @param functionImports the function imports
* @return the function imports
*/
public CsdlEntityContainer setFunctionImports(final List<CsdlFunctionImport> functionImports) {
this.functionImports = functionImports;
return this;
}
/**
* Gets singletons.
*
* @return the singletons
*/
public List<CsdlSingleton> getSingletons() {
return singletons;
}
/**
* Gets singleton.
*
* @param name the name
* @return the singleton
*/
public CsdlSingleton getSingleton(final String name) {
return getOneByName(name, getSingletons());
}
/**
* Sets singletons.
*
* @param singletons the singletons
* @return the singletons
*/
public CsdlEntityContainer setSingletons(final List<CsdlSingleton> singletons) {
this.singletons = singletons;
return this;

View File

@ -20,25 +20,50 @@ package org.apache.olingo.commons.api.edm.provider;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl entity container info.
*/
public class CsdlEntityContainerInfo {
private FullQualifiedName containerName;
private FullQualifiedName extendsContainer;
/**
* Gets container name.
*
* @return the container name
*/
public FullQualifiedName getContainerName() {
return containerName;
}
/**
* Sets container name.
*
* @param containerName the container name
* @return the container name
*/
public CsdlEntityContainerInfo setContainerName(final FullQualifiedName containerName) {
this.containerName = containerName;
return this;
}
/**
* Gets extends container.
*
* @return the extends container
*/
public FullQualifiedName getExtendsContainer() {
return extendsContainer;
}
/**
* Sets extends container.
*
* @param extendsContainer the extends container
* @return the extends container
*/
public CsdlEntityContainerInfo setExtendsContainer(final FullQualifiedName extendsContainer) {
this.extendsContainer = extendsContainer;
return this;

View File

@ -22,6 +22,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl entity set.
*/
public class CsdlEntitySet extends CsdlBindingTarget {
private static final long serialVersionUID = 5291570018480936643L;
@ -54,10 +57,21 @@ public class CsdlEntitySet extends CsdlBindingTarget {
return this;
}
/**
* Is include in service document.
*
* @return the boolean
*/
public boolean isIncludeInServiceDocument() {
return includeInServiceDocument;
}
/**
* Sets include in service document.
*
* @param includeInServiceDocument the include in service document
* @return the include in service document
*/
public CsdlEntitySet setIncludeInServiceDocument(final boolean includeInServiceDocument) {
this.includeInServiceDocument = includeInServiceDocument;
return this;

View File

@ -18,25 +18,50 @@
*/
package org.apache.olingo.commons.api.edm.provider;
/**
* The type Csdl entity set path.
*/
public class CsdlEntitySetPath {
private String bindingParameter;
private String path;
/**
* Gets binding parameter.
*
* @return the binding parameter
*/
public String getBindingParameter() {
return bindingParameter;
}
/**
* Sets binding parameter.
*
* @param bindingParameter the binding parameter
* @return the binding parameter
*/
public CsdlEntitySetPath setBindingParameter(final String bindingParameter) {
this.bindingParameter = bindingParameter;
return this;
}
/**
* Gets path.
*
* @return the path
*/
public String getPath() {
return path;
}
/**
* Sets path.
*
* @param path the path
* @return the path
*/
public CsdlEntitySetPath setPath(final String path) {
this.path = path;
return this;

View File

@ -22,6 +22,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl entity type.
*/
public class CsdlEntityType extends CsdlStructuralType {
private static final long serialVersionUID = -1564752618679704024L;
@ -30,19 +33,41 @@ public class CsdlEntityType extends CsdlStructuralType {
private boolean hasStream = false;
/**
* Has stream.
*
* @return the boolean
*/
public boolean hasStream() {
return hasStream;
}
/**
* Sets has stream.
*
* @param hasStream the has stream
* @return the has stream
*/
public CsdlEntityType setHasStream(final boolean hasStream) {
this.hasStream = hasStream;
return this;
}
/**
* Gets key.
*
* @return the key
*/
public List<CsdlPropertyRef> getKey() {
return key;
}
/**
* Sets key.
*
* @param key the key
* @return the key
*/
public CsdlEntityType setKey(final List<CsdlPropertyRef> key) {
this.key = key;
return this;

View File

@ -21,6 +21,9 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.ArrayList;
import java.util.List;
/**
* The type Csdl enum member.
*/
public class CsdlEnumMember extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = 5618984420582832094L;
@ -36,15 +39,32 @@ public class CsdlEnumMember extends CsdlAbstractEdmItem implements CsdlNamed, Cs
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlEnumMember setName(final String name) {
this.name = name;
return this;
}
/**
* Gets value.
*
* @return the value
*/
public String getValue() {
return value;
}
/**
* Sets value.
*
* @param value the value
* @return the value
*/
public CsdlEnumMember setValue(final String value) {
this.value = value;
return this;

View File

@ -23,6 +23,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl enum type.
*/
public class CsdlEnumType extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -718032622783883403L;
@ -42,20 +45,42 @@ public class CsdlEnumType extends CsdlAbstractEdmItem implements CsdlNamed, Csdl
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlEnumType setName(final String name) {
this.name = name;
return this;
}
/**
* Is flags.
*
* @return the boolean
*/
public boolean isFlags() {
return isFlags;
}
/**
* Sets flags.
*
* @param isFlags the is flags
* @return the flags
*/
public CsdlEnumType setFlags(final boolean isFlags) {
this.isFlags = isFlags;
return this;
}
/**
* Gets underlying type.
*
* @return the underlying type
*/
public String getUnderlyingType() {
if (underlyingType != null) {
return underlyingType.getFullQualifiedNameAsString();
@ -63,20 +88,43 @@ public class CsdlEnumType extends CsdlAbstractEdmItem implements CsdlNamed, Csdl
return null;
}
/**
* Sets underlying type.
*
* @param underlyingType the underlying type
* @return the underlying type
*/
public CsdlEnumType setUnderlyingType(final String underlyingType) {
this.underlyingType = new FullQualifiedName(underlyingType);
return this;
}
/**
* Sets underlying type.
*
* @param underlyingType the underlying type
* @return the underlying type
*/
public CsdlEnumType setUnderlyingType(final FullQualifiedName underlyingType) {
this.underlyingType = underlyingType;
return this;
}
/**
* Gets members.
*
* @return the members
*/
public List<CsdlEnumMember> getMembers() {
return members;
}
/**
* Gets member.
*
* @param name the name
* @return the member
*/
public CsdlEnumMember getMember(final String name) {
CsdlEnumMember result = null;
if (getMembers() != null) {
@ -89,6 +137,12 @@ public class CsdlEnumType extends CsdlAbstractEdmItem implements CsdlNamed, Csdl
return result;
}
/**
* Gets member.
*
* @param value the value
* @return the member
*/
public CsdlEnumMember getMember(final Integer value) {
CsdlEnumMember result = null;
if (getMembers() != null) {
@ -101,6 +155,12 @@ public class CsdlEnumType extends CsdlAbstractEdmItem implements CsdlNamed, Csdl
return result;
}
/**
* Sets members.
*
* @param members the members
* @return the members
*/
public CsdlEnumType setMembers(final List<CsdlEnumMember> members) {
this.members = members;
return this;

View File

@ -18,6 +18,9 @@
*/
package org.apache.olingo.commons.api.edm.provider;
/**
* The type Csdl expression.
*/
public class CsdlExpression {
// TODO: Expression implementation
}

View File

@ -20,16 +20,30 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.List;
/**
* The type Csdl function.
*/
public class CsdlFunction extends CsdlOperation {
private static final long serialVersionUID = 673858921468578957L;
private boolean isComposable = false;
/**
* Is composable.
*
* @return the boolean
*/
public boolean isComposable() {
return isComposable;
}
/**
* Sets composable.
*
* @param isComposable the is composable
* @return the composable
*/
public CsdlFunction setComposable(final boolean isComposable) {
this.isComposable = isComposable;
return this;

View File

@ -20,6 +20,9 @@ package org.apache.olingo.commons.api.edm.provider;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl function import.
*/
public class CsdlFunctionImport extends CsdlOperationImport {
private static final long serialVersionUID = 8479762299534736719L;
@ -46,28 +49,61 @@ public class CsdlFunctionImport extends CsdlOperationImport {
return this;
}
/**
* Gets function.
*
* @return the function
*/
public String getFunction() {
return function.getFullQualifiedNameAsString();
}
/**
* Gets function fQN.
*
* @return the function fQN
*/
public FullQualifiedName getFunctionFQN() {
return function;
}
/**
* Sets function.
*
* @param function the function
* @return the function
*/
public CsdlFunctionImport setFunction(final FullQualifiedName function) {
this.function = function;
return this;
}
/**
* Sets function.
*
* @param function the function
* @return the function
*/
public CsdlFunctionImport setFunction(final String function) {
this.function = new FullQualifiedName(function);
return this;
}
/**
* Is include in service document.
*
* @return the boolean
*/
public boolean isIncludeInServiceDocument() {
return includeInServiceDocument;
}
/**
* Sets include in service document.
*
* @param includeInServiceDocument the include in service document
* @return the include in service document
*/
public CsdlFunctionImport setIncludeInServiceDocument(final boolean includeInServiceDocument) {
this.includeInServiceDocument = includeInServiceDocument;
return this;

View File

@ -18,8 +18,15 @@
*/
package org.apache.olingo.commons.api.edm.provider;
/**
* The interface Csdl named.
*/
public interface CsdlNamed {
/**
* Gets name.
*
* @return the name
*/
String getName();
}

View File

@ -23,6 +23,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl navigation property.
*/
public class CsdlNavigationProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -788021920718310799L;
@ -51,24 +54,51 @@ public class CsdlNavigationProperty extends CsdlAbstractEdmItem implements CsdlN
return name;
}
/**
* Is collection.
*
* @return the boolean
*/
public boolean isCollection() {
return isCollection;
}
/**
* Sets collection.
*
* @param isCollection the is collection
* @return the collection
*/
public CsdlNavigationProperty setCollection(final boolean isCollection) {
this.isCollection = isCollection;
return this;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlNavigationProperty setName(final String name) {
this.name = name;
return this;
}
/**
* Gets type fQN.
*
* @return the type fQN
*/
public FullQualifiedName getTypeFQN() {
return type;
}
/**
* Gets type.
*
* @return the type
*/
public String getType() {
if (type != null) {
return type.getFullQualifiedNameAsString();
@ -76,57 +106,124 @@ public class CsdlNavigationProperty extends CsdlAbstractEdmItem implements CsdlN
return null;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlNavigationProperty setType(final FullQualifiedName type) {
this.type = type;
return this;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlNavigationProperty setType(final String type) {
this.type = new FullQualifiedName(type);
return this;
}
/**
* Gets partner.
*
* @return the partner
*/
public String getPartner() {
return partner;
}
/**
* Sets partner.
*
* @param partner the partner
* @return the partner
*/
public CsdlNavigationProperty setPartner(final String partner) {
this.partner = partner;
return this;
}
/**
* Is contains target.
*
* @return the boolean
*/
public boolean isContainsTarget() {
return containsTarget;
}
/**
* Sets contains target.
*
* @param containsTarget the contains target
* @return the contains target
*/
public CsdlNavigationProperty setContainsTarget(final boolean containsTarget) {
this.containsTarget = containsTarget;
return this;
}
/**
* Gets referential constraints.
*
* @return the referential constraints
*/
public List<CsdlReferentialConstraint> getReferentialConstraints() {
return referentialConstraints;
}
/**
* Sets referential constraints.
*
* @param referentialConstraints the referential constraints
* @return the referential constraints
*/
public CsdlNavigationProperty setReferentialConstraints(
final List<CsdlReferentialConstraint> referentialConstraints) {
this.referentialConstraints = referentialConstraints;
return this;
}
/**
* Is nullable.
*
* @return the boolean
*/
public Boolean isNullable() {
return nullable;
}
/**
* Sets nullable.
*
* @param nullable the nullable
* @return the nullable
*/
public CsdlNavigationProperty setNullable(final Boolean nullable) {
this.nullable = nullable;
return this;
}
/**
* Gets on delete.
*
* @return the on delete
*/
public CsdlOnDelete getOnDelete() {
return onDelete;
}
/**
* Sets on delete.
*
* @param onDelete the on delete
* @return the on delete
*/
public CsdlNavigationProperty setOnDelete(final CsdlOnDelete onDelete) {
this.onDelete = onDelete;
return this;

View File

@ -18,6 +18,9 @@
*/
package org.apache.olingo.commons.api.edm.provider;
/**
* The type Csdl navigation property binding.
*/
public class CsdlNavigationPropertyBinding extends CsdlAbstractEdmItem {
private static final long serialVersionUID = 770380971233808502L;
@ -26,19 +29,41 @@ public class CsdlNavigationPropertyBinding extends CsdlAbstractEdmItem {
private String target;
/**
* Gets path.
*
* @return the path
*/
public String getPath() {
return path;
}
/**
* Sets path.
*
* @param path the path
* @return the path
*/
public CsdlNavigationPropertyBinding setPath(final String path) {
this.path = path;
return this;
}
/**
* Gets target.
*
* @return the target
*/
public String getTarget() {
return target;
}
/**
* Sets target.
*
* @param target the target
* @return the target
*/
public CsdlNavigationPropertyBinding setTarget(final String target) {
this.target = target;
return this;

View File

@ -18,16 +18,30 @@
*/
package org.apache.olingo.commons.api.edm.provider;
/**
* The type Csdl on delete.
*/
public class CsdlOnDelete extends CsdlAbstractEdmItem {
private static final long serialVersionUID = -7130889202653716784L;
private CsdlOnDeleteAction action = CsdlOnDeleteAction.None;
/**
* Gets action.
*
* @return the action
*/
public CsdlOnDeleteAction getAction() {
return action;
}
/**
* Sets action.
*
* @param action the action
* @return the action
*/
public CsdlOnDelete setAction(final CsdlOnDeleteAction action) {
this.action = action;
return this;

View File

@ -18,11 +18,25 @@
*/
package org.apache.olingo.commons.api.edm.provider;
/**
* The enum Csdl on delete action.
*/
public enum CsdlOnDeleteAction {
/**
* The Cascade.
*/
Cascade,
/**
* The None.
*/
None,
/**
* The SetNull.
*/
SetNull,
/**
* The SetDefault.
*/
SetDefault
}

View File

@ -21,20 +21,41 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.ArrayList;
import java.util.List;
/**
* The type Csdl operation.
*/
public abstract class CsdlOperation extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -3842411084067064086L;
/**
* The Name.
*/
protected String name;
/**
* The Is bound.
*/
protected boolean isBound = false;
/**
* The Entity set path.
*/
protected String entitySetPath;
/**
* The Parameters.
*/
protected List<CsdlParameter> parameters = new ArrayList<CsdlParameter>();
/**
* The Return type.
*/
protected CsdlReturnType returnType;
/**
* The Annotations.
*/
protected final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
@Override
@ -42,46 +63,102 @@ public abstract class CsdlOperation extends CsdlAbstractEdmItem implements CsdlN
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlOperation setName(final String name) {
this.name = name;
return this;
}
/**
* Is bound.
*
* @return the boolean
*/
public boolean isBound() {
return isBound;
}
/**
* Sets as bound operation.
*
* @param isBound the is bound
* @return the bound
*/
public CsdlOperation setBound(final boolean isBound) {
this.isBound = isBound;
return this;
}
/**
* Gets entity set path.
*
* @return the entity set path
*/
public String getEntitySetPath() {
return entitySetPath;
}
/**
* Sets entity set path.
*
* @param entitySetPath the entity set path
* @return the entity set path
*/
public CsdlOperation setEntitySetPath(final String entitySetPath) {
this.entitySetPath = entitySetPath;
return this;
}
/**
* Gets parameters.
*
* @return the parameters
*/
public List<CsdlParameter> getParameters() {
return parameters;
}
/**
* Gets parameter.
*
* @param name the name
* @return the parameter
*/
public CsdlParameter getParameter(final String name) {
return getOneByName(name, getParameters());
}
/**
* Sets parameters.
*
* @param parameters the parameters
* @return the parameters
*/
public CsdlOperation setParameters(final List<CsdlParameter> parameters) {
this.parameters = parameters;
return this;
}
/**
* Gets return type.
*
* @return the return type
*/
public CsdlReturnType getReturnType() {
return returnType;
}
/**
* Sets return type.
*
* @param returnType the return type
* @return the return type
*/
public CsdlOperation setReturnType(final CsdlReturnType returnType) {
this.returnType = returnType;
return this;

View File

@ -21,12 +21,24 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.ArrayList;
import java.util.List;
/**
* The type Csdl operation import.
*/
public abstract class CsdlOperationImport extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -8928186067970681061L;
/**
* The Name.
*/
protected String name;
/**
* The Entity set.
*/
protected String entitySet;
/**
* The Annotations.
*/
protected final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
@Override
@ -34,15 +46,32 @@ public abstract class CsdlOperationImport extends CsdlAbstractEdmItem implements
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlOperationImport setName(final String name) {
this.name = name;
return this;
}
/**
* Gets entity set.
*
* @return the entity set
*/
public String getEntitySet() {
return entitySet;
}
/**
* Sets entity set.
*
* @param entitySet the entity set
* @return the entity set
*/
public CsdlOperationImport setEntitySet(final String entitySet) {
this.entitySet = entitySet;
return this;

View File

@ -24,6 +24,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID;
/**
* The type Csdl parameter.
*/
public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -7360900923880732015L;
@ -54,78 +57,172 @@ public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, Csd
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlParameter setName(final String name) {
this.name = name;
return this;
}
/**
* Gets type.
*
* @return the type
*/
public String getType() {
return type.getFullQualifiedNameAsString();
}
/**
* Gets type fQN.
*
* @return the type fQN
*/
public FullQualifiedName getTypeFQN() {
return type;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlParameter setType(final String type) {
this.type = new FullQualifiedName(type);
return this;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlParameter setType(final FullQualifiedName type) {
this.type = type;
return this;
}
/**
* Is collection.
*
* @return the boolean
*/
public boolean isCollection() {
return isCollection;
}
/**
* Sets collection.
*
* @param isCollection the is collection
* @return the collection
*/
public CsdlParameter setCollection(final boolean isCollection) {
this.isCollection = isCollection;
return this;
}
/**
* Is nullable.
*
* @return the boolean
*/
public boolean isNullable() {
return nullable;
}
/**
* Sets nullable.
*
* @param nullable the nullable
* @return the nullable
*/
public CsdlParameter setNullable(final boolean nullable) {
this.nullable = nullable;
return this;
}
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() {
return maxLength;
}
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlParameter setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
return this;
}
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() {
return precision;
}
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlParameter setPrecision(final Integer precision) {
this.precision = precision;
return this;
}
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() {
return scale;
}
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlParameter setScale(final Integer scale) {
this.scale = scale;
return this;
}
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() {
return srid;
}
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlParameter setSrid(final SRID srid) {
this.srid = srid;
return this;
@ -136,10 +233,21 @@ public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, Csd
return annotations;
}
/**
* Gets mapping.
*
* @return the mapping
*/
public CsdlMapping getMapping() {
return mapping;
}
/**
* Sets mapping.
*
* @param mapping the mapping
* @return the mapping
*/
public CsdlParameter setMapping(final CsdlMapping mapping) {
this.mapping = mapping;
return this;

View File

@ -24,6 +24,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID;
/**
* The type Csdl property.
*/
public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -4224390853690843450L;
@ -60,105 +63,232 @@ public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, Csdl
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlProperty setName(final String name) {
this.name = name;
return this;
}
/**
* Gets type.
*
* @return the type
*/
public String getType() {
return type;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlProperty setType(final String type) {
this.type = type;
return this;
}
/**
* Gets type as fQN object.
*
* @return the type as fQN object
*/
public FullQualifiedName getTypeAsFQNObject() {
return new FullQualifiedName(type);
}
/**
* Sets type.
*
* @param fqnName the fqn name
* @return the type
*/
public CsdlProperty setType(final FullQualifiedName fqnName) {
type = fqnName.getFullQualifiedNameAsString();
return this;
}
/**
* Is collection.
*
* @return the boolean
*/
public boolean isCollection() {
return collection;
}
/**
* Sets collection.
*
* @param isCollection the is collection
* @return the collection
*/
public CsdlProperty setCollection(final boolean isCollection) {
collection = isCollection;
return this;
}
/**
* Gets default value.
*
* @return the default value
*/
public String getDefaultValue() {
return defaultValue;
}
/**
* Sets default value.
*
* @param defaultValue the default value
* @return the default value
*/
public CsdlProperty setDefaultValue(final String defaultValue) {
this.defaultValue = defaultValue;
return this;
}
/**
* Is nullable.
*
* @return the boolean
*/
public boolean isNullable() {
return nullable;
}
/**
* Sets nullable.
*
* @param nullable the nullable
* @return the nullable
*/
public CsdlProperty setNullable(final boolean nullable) {
this.nullable = nullable;
return this;
}
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() {
return maxLength;
}
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlProperty setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
return this;
}
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() {
return precision;
}
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlProperty setPrecision(final Integer precision) {
this.precision = precision;
return this;
}
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() {
return scale;
}
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlProperty setScale(final Integer scale) {
this.scale = scale;
return this;
}
/**
* Is unicode.
*
* @return the boolean
*/
public boolean isUnicode() {
return unicode;
}
/**
* Sets unicode.
*
* @param unicode the unicode
* @return the unicode
*/
public CsdlProperty setUnicode(final boolean unicode) {
this.unicode = unicode;
return this;
}
/**
* Gets mime type.
*
* @return the mime type
*/
public String getMimeType() {
return mimeType;
}
/**
* Sets mime type.
*
* @param mimeType the mime type
* @return the mime type
*/
public CsdlProperty setMimeType(final String mimeType) {
this.mimeType = mimeType;
return this;
}
/**
* Gets mapping.
*
* @return the mapping
*/
public CsdlMapping getMapping() {
return mapping;
}
/**
* Sets mapping.
*
* @param mapping the mapping
* @return the mapping
*/
public CsdlProperty setMapping(final CsdlMapping mapping) {
this.mapping = mapping;
return this;
@ -169,11 +299,22 @@ public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, Csdl
return annotations;
}
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlProperty setSrid(final SRID srid) {
this.srid = srid;
return this;
}
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() {
return srid;
}

View File

@ -18,6 +18,9 @@
*/
package org.apache.olingo.commons.api.edm.provider;
/**
* The type Csdl property ref.
*/
public class CsdlPropertyRef extends CsdlAbstractEdmItem implements CsdlNamed {
private static final long serialVersionUID = 9082892362895660037L;
@ -31,15 +34,32 @@ public class CsdlPropertyRef extends CsdlAbstractEdmItem implements CsdlNamed {
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlPropertyRef setName(final String name) {
this.name = name;
return this;
}
/**
* Gets alias.
*
* @return the alias
*/
public String getAlias() {
return alias;
}
/**
* Sets alias.
*
* @param alias the alias
* @return the alias
*/
public CsdlPropertyRef setAlias(final String alias) {
this.alias = alias;
return this;

View File

@ -21,6 +21,9 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.ArrayList;
import java.util.List;
/**
* The type Csdl referential constraint.
*/
public class CsdlReferentialConstraint extends CsdlAbstractEdmItem implements CsdlAnnotatable {
private static final long serialVersionUID = -7467707499798840075L;
@ -31,19 +34,41 @@ public class CsdlReferentialConstraint extends CsdlAbstractEdmItem implements Cs
private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
/**
* Gets property.
*
* @return the property
*/
public String getProperty() {
return property;
}
/**
* Sets property.
*
* @param property the property
* @return the property
*/
public CsdlReferentialConstraint setProperty(final String property) {
this.property = property;
return this;
}
/**
* Gets referenced property.
*
* @return the referenced property
*/
public String getReferencedProperty() {
return referencedProperty;
}
/**
* Sets referenced property.
*
* @param referencedProperty the referenced property
* @return the referenced property
*/
public CsdlReferentialConstraint setReferencedProperty(final String referencedProperty) {
this.referencedProperty = referencedProperty;
return this;

View File

@ -21,6 +21,9 @@ 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;
/**
* The type Csdl return type.
*/
public class CsdlReturnType extends CsdlAbstractEdmItem {
private static final long serialVersionUID = 4816954124986010965L;
@ -40,73 +43,161 @@ public class CsdlReturnType extends CsdlAbstractEdmItem {
private SRID srid;
/**
* Gets type.
*
* @return the type
*/
public String getType() {
return type.getFullQualifiedNameAsString();
}
/**
* Gets type fQN.
*
* @return the type fQN
*/
public FullQualifiedName getTypeFQN() {
return type;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlReturnType setType(final String type) {
this.type = new FullQualifiedName(type);
return this;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlReturnType setType(final FullQualifiedName type) {
this.type = type;
return this;
}
/**
* Is collection.
*
* @return the boolean
*/
public boolean isCollection() {
return isCollection;
}
/**
* Sets collection.
*
* @param isCollection the is collection
* @return the collection
*/
public CsdlReturnType setCollection(final boolean isCollection) {
this.isCollection = isCollection;
return this;
}
/**
* Is nullable.
*
* @return the boolean
*/
public boolean isNullable() {
return nullable;
}
/**
* Sets nullable.
*
* @param nullable the nullable
* @return the nullable
*/
public CsdlReturnType setNullable(final boolean nullable) {
this.nullable = nullable;
return this;
}
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() {
return maxLength;
}
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlReturnType setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
return this;
}
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() {
return precision;
}
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlReturnType setPrecision(final Integer precision) {
this.precision = precision;
return this;
}
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() {
return scale;
}
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlReturnType setScale(final Integer scale) {
this.scale = scale;
return this;
}
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() {
return srid;
}
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlReturnType setSrid(final SRID srid) {
this.srid = srid;
return this;

View File

@ -23,6 +23,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* The type Csdl schema.
*/
public class CsdlSchema extends CsdlAbstractEdmItem implements CsdlAnnotatable {
private static final long serialVersionUID = -1527213201328056750L;
@ -53,138 +56,289 @@ public class CsdlSchema extends CsdlAbstractEdmItem implements CsdlAnnotatable {
private Map<String, CsdlAnnotatable> annotatables;
/**
* Gets namespace.
*
* @return the namespace
*/
public String getNamespace() {
return namespace;
}
/**
* Sets namespace.
*
* @param namespace the namespace
* @return the namespace
*/
public CsdlSchema setNamespace(final String namespace) {
this.namespace = namespace;
return this;
}
/**
* Gets alias.
*
* @return the alias
*/
public String getAlias() {
return alias;
}
/**
* Sets alias.
*
* @param alias the alias
* @return the alias
*/
public CsdlSchema setAlias(final String alias) {
this.alias = alias;
return this;
}
/**
* Gets enum types.
*
* @return the enum types
*/
public List<CsdlEnumType> getEnumTypes() {
return enumTypes;
}
/**
* Gets enum type.
*
* @param name the name
* @return the enum type
*/
public CsdlEnumType getEnumType(final String name) {
return getOneByName(name, getEnumTypes());
}
/**
* Sets enum types.
*
* @param enumTypes the enum types
* @return the enum types
*/
public CsdlSchema setEnumTypes(final List<CsdlEnumType> enumTypes) {
this.enumTypes = enumTypes;
return this;
}
/**
* Gets type definitions.
*
* @return the type definitions
*/
public List<CsdlTypeDefinition> getTypeDefinitions() {
return typeDefinitions;
}
/**
* Gets type definition.
*
* @param name the name
* @return the type definition
*/
public CsdlTypeDefinition getTypeDefinition(final String name) {
return getOneByName(name, getTypeDefinitions());
}
/**
* Sets type definitions.
*
* @param typeDefinitions the type definitions
* @return the type definitions
*/
public CsdlSchema setTypeDefinitions(final List<CsdlTypeDefinition> typeDefinitions) {
this.typeDefinitions = typeDefinitions;
return this;
}
/**
* Gets entity types.
*
* @return the entity types
*/
public List<CsdlEntityType> getEntityTypes() {
return entityTypes;
}
/**
* Gets entity type.
*
* @param name the name
* @return the entity type
*/
public CsdlEntityType getEntityType(final String name) {
return getOneByName(name, getEntityTypes());
}
/**
* Sets entity types.
*
* @param entityTypes the entity types
* @return the entity types
*/
public CsdlSchema setEntityTypes(final List<CsdlEntityType> entityTypes) {
this.entityTypes = entityTypes;
return this;
}
/**
* Gets complex types.
*
* @return the complex types
*/
public List<CsdlComplexType> getComplexTypes() {
return complexTypes;
}
/**
* Gets complex type.
*
* @param name the name
* @return the complex type
*/
public CsdlComplexType getComplexType(final String name) {
return getOneByName(name, getComplexTypes());
}
/**
* Sets complex types.
*
* @param complexTypes the complex types
* @return the complex types
*/
public CsdlSchema setComplexTypes(final List<CsdlComplexType> complexTypes) {
this.complexTypes = complexTypes;
return this;
}
/**
* Gets actions.
*
* @return the actions
*/
public List<CsdlAction> getActions() {
return actions;
}
/**
* All actions with the given name
* @param name
* @param name the name
* @return a list of actions
*/
public List<CsdlAction> getActions(final String name) {
return getAllByName(name, getActions());
}
/**
* Sets actions.
*
* @param actions the actions
* @return the actions
*/
public CsdlSchema setActions(final List<CsdlAction> actions) {
this.actions = actions;
return this;
}
/**
* Gets functions.
*
* @return the functions
*/
public List<CsdlFunction> getFunctions() {
return functions;
}
/**
* All functions with the given name
* @param name
* @param name the name
* @return a list of functions
*/
public List<CsdlFunction> getFunctions(final String name) {
return getAllByName(name, getFunctions());
}
/**
* Sets functions.
*
* @param functions the functions
* @return the functions
*/
public CsdlSchema setFunctions(final List<CsdlFunction> functions) {
this.functions = functions;
return this;
}
/**
* Gets entity container.
*
* @return the entity container
*/
public CsdlEntityContainer getEntityContainer() {
return entityContainer;
}
/**
* Sets entity container.
*
* @param entityContainer the entity container
* @return the entity container
*/
public CsdlSchema setEntityContainer(final CsdlEntityContainer entityContainer) {
this.entityContainer = entityContainer;
return this;
}
/**
* Gets terms.
*
* @return the terms
*/
public List<CsdlTerm> getTerms() {
return terms;
}
/**
* Gets term.
*
* @param name the name
* @return the term
*/
public CsdlTerm getTerm(final String name) {
return getOneByName(name, getTerms());
}
/**
* Sets terms.
*
* @param terms the terms
* @return the terms
*/
public CsdlSchema setTerms(final List<CsdlTerm> terms) {
this.terms = terms;
return this;
}
/**
* Gets annotation groups.
*
* @return the annotation groups
*/
public List<CsdlAnnotations> getAnnotationGroups() {
return annotationGroups;
}
/**
* Gets annotation group.
*
* @param target the target
* @return the annotation group
*/
public CsdlAnnotations getAnnotationGroup(final String target) {
CsdlAnnotations result = null;
for (CsdlAnnotations annots : getAnnotationGroups()) {
@ -195,6 +349,12 @@ public class CsdlSchema extends CsdlAbstractEdmItem implements CsdlAnnotatable {
return result;
}
/**
* Gets annotation.
*
* @param term the term
* @return the annotation
*/
public CsdlAnnotation getAnnotation(final String term) {
CsdlAnnotation result = null;
for (CsdlAnnotation annot : getAnnotations()) {
@ -210,6 +370,11 @@ public class CsdlSchema extends CsdlAbstractEdmItem implements CsdlAnnotatable {
return annotations;
}
/**
* Gets annotatables.
*
* @return the annotatables
*/
public Map<String, CsdlAnnotatable> getAnnotatables() {
if (annotatables == null) {
annotatables = new HashMap<String, CsdlAnnotatable>();

View File

@ -22,6 +22,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl singleton.
*/
public class CsdlSingleton extends CsdlBindingTarget {
private static final long serialVersionUID = -3997943079062565895L;

View File

@ -23,22 +23,46 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl structural type.
*/
public abstract class CsdlStructuralType extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = 8662852373514258646L;
/**
* The Name.
*/
protected String name;
/**
* The Is open type.
*/
protected boolean isOpenType = false;
/**
* The Base type.
*/
protected FullQualifiedName baseType;
/**
* The Is abstract.
*/
protected boolean isAbstract;
/**
* The Properties.
*/
protected List<CsdlProperty> properties = new ArrayList<CsdlProperty>();
/**
* The Navigation properties.
*/
protected List<CsdlNavigationProperty> navigationProperties = new ArrayList<CsdlNavigationProperty>();
/**
* The Annotations.
*/
protected final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
@Override
@ -46,20 +70,42 @@ public abstract class CsdlStructuralType extends CsdlAbstractEdmItem implements
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlStructuralType setName(final String name) {
this.name = name;
return this;
}
/**
* Is open type.
*
* @return the boolean
*/
public boolean isOpenType() {
return isOpenType;
}
/**
* Sets open type.
*
* @param isOpenType the is open type
* @return the open type
*/
public CsdlStructuralType setOpenType(final boolean isOpenType) {
this.isOpenType = isOpenType;
return this;
}
/**
* Gets base type.
*
* @return the base type
*/
public String getBaseType() {
if (baseType != null) {
return baseType.getFullQualifiedNameAsString();
@ -67,50 +113,112 @@ public abstract class CsdlStructuralType extends CsdlAbstractEdmItem implements
return null;
}
/**
* Gets base type fQN.
*
* @return the base type fQN
*/
public FullQualifiedName getBaseTypeFQN() {
return baseType;
}
/**
* Sets base type.
*
* @param baseType the base type
* @return the base type
*/
public CsdlStructuralType setBaseType(final String baseType) {
this.baseType = new FullQualifiedName(baseType);
return this;
}
/**
* Sets base type.
*
* @param baseType the base type
* @return the base type
*/
public CsdlStructuralType setBaseType(final FullQualifiedName baseType) {
this.baseType = baseType;
return this;
}
/**
* Is abstract.
*
* @return the boolean
*/
public boolean isAbstract() {
return isAbstract;
}
/**
* Sets abstract.
*
* @param isAbstract the is abstract
* @return the abstract
*/
public CsdlStructuralType setAbstract(final boolean isAbstract) {
this.isAbstract = isAbstract;
return this;
}
/**
* Gets properties.
*
* @return the properties
*/
public List<CsdlProperty> getProperties() {
return properties;
}
/**
* Gets property.
*
* @param name the name
* @return the property
*/
public CsdlProperty getProperty(final String name) {
return getOneByName(name, properties);
}
/**
* Sets properties.
*
* @param properties the properties
* @return the properties
*/
public CsdlStructuralType setProperties(final List<CsdlProperty> properties) {
this.properties = properties;
return this;
}
/**
* Gets navigation properties.
*
* @return the navigation properties
*/
public List<CsdlNavigationProperty> getNavigationProperties() {
return navigationProperties;
}
/**
* Gets navigation property.
*
* @param name the name
* @return the navigation property
*/
public CsdlNavigationProperty getNavigationProperty(final String name) {
return getOneByName(name, navigationProperties);
}
/**
* Sets navigation properties.
*
* @param navigationProperties the navigation properties
* @return the navigation properties
*/
public CsdlStructuralType setNavigationProperties(final List<CsdlNavigationProperty> navigationProperties) {
this.navigationProperties = navigationProperties;
return this;

View File

@ -23,6 +23,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.geo.SRID;
/**
* The type Csdl term.
*/
public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = 3843929000407818103L;
@ -57,87 +60,192 @@ public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnno
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlTerm setName(final String name) {
this.name = name;
return this;
}
/**
* Gets type.
*
* @return the type
*/
public String getType() {
return type;
}
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlTerm setType(final String type) {
this.type = type;
return this;
}
/**
* Gets base term.
*
* @return the base term
*/
public String getBaseTerm() {
return baseTerm;
}
/**
* Sets base term.
*
* @param baseTerm the base term
* @return the base term
*/
public CsdlTerm setBaseTerm(final String baseTerm) {
this.baseTerm = baseTerm;
return this;
}
/**
* Gets applies to.
*
* @return the applies to
*/
public List<String> getAppliesTo() {
return appliesTo;
}
/**
* Sets applies to.
*
* @param appliesTo the applies to
* @return the applies to
*/
public CsdlTerm setAppliesTo(final List<String> appliesTo) {
this.appliesTo = appliesTo;
return this;
}
/**
* Is collection.
*
* @return the boolean
*/
public boolean isCollection() {
return isCollection;
}
/**
* Sets collection.
*
* @param isCollection the is collection
* @return the collection
*/
public CsdlTerm setCollection(final boolean isCollection) {
this.isCollection = isCollection;
return this;
}
/**
* Gets default value.
*
* @return the default value
*/
public String getDefaultValue() {
return defaultValue;
}
/**
* Sets default value.
*
* @param defaultValue the default value
* @return the default value
*/
public CsdlTerm setDefaultValue(final String defaultValue) {
this.defaultValue = defaultValue;
return this;
}
/**
* Is nullable.
*
* @return the boolean
*/
public boolean isNullable() {
return nullable;
}
/**
* Sets nullable.
*
* @param nullable the nullable
* @return the nullable
*/
public CsdlTerm setNullable(final boolean nullable) {
this.nullable = nullable;
return this;
}
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() {
return maxLength;
}
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlTerm setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
return this;
}
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() {
return precision;
}
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlTerm setPrecision(final Integer precision) {
this.precision = precision;
return this;
}
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() {
return scale;
}
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlTerm setScale(final Integer scale) {
this.scale = scale;
return this;
@ -148,15 +256,32 @@ public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnno
return annotations;
}
/**
* Sets annotations.
*
* @param annotations the annotations
* @return the annotations
*/
public CsdlTerm setAnnotations(final List<CsdlAnnotation> annotations) {
this.annotations = annotations;
return this;
}
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() {
return srid;
}
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlTerm setSrid(final SRID srid) {
this.srid = srid;
return this;

View File

@ -24,6 +24,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID;
/**
* The type Csdl type definition.
*/
public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = 3718980071229613048L;
@ -50,11 +53,22 @@ public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed
return name;
}
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlTypeDefinition setName(final String name) {
this.name = name;
return this;
}
/**
* Gets underlying type.
*
* @return the underlying type
*/
public String getUnderlyingType() {
if (underlyingType != null) {
return underlyingType.getFullQualifiedNameAsString();
@ -62,56 +76,123 @@ public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed
return null;
}
/**
* Sets underlying type.
*
* @param underlyingType the underlying type
* @return the underlying type
*/
public CsdlTypeDefinition setUnderlyingType(final String underlyingType) {
this.underlyingType = new FullQualifiedName(underlyingType);
return this;
}
/**
* Sets underlying type.
*
* @param underlyingType the underlying type
* @return the underlying type
*/
public CsdlTypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) {
this.underlyingType = underlyingType;
return this;
}
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() {
return maxLength;
}
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlTypeDefinition setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
return this;
}
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() {
return precision;
}
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlTypeDefinition setPrecision(final Integer precision) {
this.precision = precision;
return this;
}
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() {
return scale;
}
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlTypeDefinition setScale(final Integer scale) {
this.scale = scale;
return this;
}
/**
* Is unicode.
*
* @return the boolean
*/
public boolean isUnicode() {
return unicode;
}
/**
* Sets unicode.
*
* @param unicode the unicode
* @return the unicode
*/
public CsdlTypeDefinition setUnicode(final boolean unicode) {
this.unicode = unicode;
return this;
}
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() {
return srid;
}
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlTypeDefinition setSrid(final SRID srid) {
this.srid = srid;
return this;

View File

@ -28,25 +28,25 @@ import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpressi
* A expression is either constant or dynamic
*/
public interface AnnotationExpression extends Serializable {
/**
* Return true if the expression is constant
* @return true if the expression is constant
*/
boolean isConstant();
/**
* Casts the expression to {@link EdmConstantAnnotationExpression}
* @return Constant Expression
*/
ConstantAnnotationExpression asConstant();
/**
* Return true if the expression is dynamic
* @return true if the expression is dynamic
*/
boolean isDynamic();
/**
* Cast the expression to {@link EdmDynamicAnnotationExpression}
* @return Dynamic Expression

View File

@ -22,7 +22,7 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
* Represents an annotation path
*/
public interface AnnotationPath extends DynamicAnnotationExpression {
/**
* Value of the path
* @return value of the path

View File

@ -26,7 +26,7 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
* Represents an Edm:Apply expression
*/
public interface Apply extends DynamicAnnotationExpression, CsdlAnnotatable {
/**
* A QualifiedName specifying the name of the client-side function to apply.
* <br/>
@ -34,13 +34,13 @@ public interface Apply extends DynamicAnnotationExpression, CsdlAnnotatable {
* namespace or alias other than odata. Function names qualified with odata are reserved for this specification and
* its future versions.
*
* @return function full qualified name
* @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_CONCAT
* @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_FILLURITEMPLATE
* @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_URIENCODE
* @return function full qualified name
*/
String getFunction();
/**
* Returns the expressions applied to the parameters of the function
* @return List of expression

View File

@ -31,7 +31,7 @@ public interface Cast extends DynamicAnnotationExpression, CsdlAnnotatable {
* @return Returns the facet attribute MaxLength
*/
Integer getMaxLength();
/**
* Returns the facet attribute Precision
* @return Returns the facet attribute Precision
@ -49,13 +49,13 @@ public interface Cast extends DynamicAnnotationExpression, CsdlAnnotatable {
* @return Returns the facet attribute SRID
*/
SRID getSrid();
/**
* Value cast to
* @return value cast to
*/
String getType();
/**
* Cast value of the expression
* @return Cast value

View File

@ -26,7 +26,7 @@ import java.util.List;
* by each of the child expressions.
*/
public interface Collection extends DynamicAnnotationExpression {
/**
* Returns a list of child expression
* @return List of child expression

View File

@ -22,7 +22,7 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
* Represents a constant expression
*/
public interface ConstantAnnotationExpression extends AnnotationExpression {
/**
* Type of the constant expression
*/
@ -75,11 +75,11 @@ public interface ConstantAnnotationExpression extends AnnotationExpression {
* Type Edm.TimeOfDay
*/
TimeOfDay;
/**
* Creates a new type by a given string e.g. "TimeOfDay"
* @param value Type as string
* @return Type
* @return Type type
*/
public static Type fromString(final String value) {
Type result = null;
@ -97,19 +97,19 @@ public interface ConstantAnnotationExpression extends AnnotationExpression {
* @return type of the constant expresion
*/
Type getType();
/**
* Sets the type of the constant expression
* @param type
* @param type type of the constant expression
*/
void setType(Type type);
/**
* Value of the constant expression
* @return value of the constant expression as String
*/
String getValue();
/**
* Sets the value of the constant expression
* @param value value of the constant expression

View File

@ -22,19 +22,19 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
* Represents a dynamic expression
*/
public interface DynamicAnnotationExpression extends AnnotationExpression {
/**
* Returns true if the expression is a logical edm:Not expression
* @return true if the expression is a logical edm:Not expression
* @return true if the expression is a logical edm:Not expression
*/
boolean isNot();
/**
* Casts the expression to a {@link Not} expression
* @return Not expression
*/
Not asNot();
/**
* Returns true iff the annotation is an expression with two operands.
* If so, the expression is one of:
@ -47,164 +47,164 @@ public interface DynamicAnnotationExpression extends AnnotationExpression {
* <li>Ge</li>
* <li>Lt</li>
* <li>Le</li>
*
*
* @return true iff the annotation is an expression with two operands.
*/
boolean isTwoParamsOp();
/**
* Casts the expression as {@link TwoParamsOpDynamicAnnotationExpression}
* @return TwoParamsOpDynamicAnnotationExpression
* @return TwoParamsOpDynamicAnnotationExpression two params op dynamic annotation expression
*/
TwoParamsOpDynamicAnnotationExpression asTwoParamsOp();
/**
* Returns true if the expression is a edm:AnnotationPath expression
* @return true if the expression is a edm:AnnotationPath expression
* @return true if the expression is a edm:AnnotationPath expression
*/
boolean isAnnotationPath();
/**
* Casts the expression to a {@link AnnotationPath} expression
* @return AnnotationPath expression
*/
AnnotationPath asAnnotationPath();
/**
* Returns true if the expression is a edm:Apply expression
* @return true if the expression is a edm:Apply expression
* @return true if the expression is a edm:Apply expression
*/
boolean isApply();
/**
* Casts the expression to a {@link Apply} expression
* @return Apply expression
*/
Apply asApply();
/**
* Returns true if the expression is a edm:Cast expression
* @return true if the expression is a edm:Cast expression
* @return true if the expression is a edm:Cast expression
*/
boolean isCast();
/**
* Casts the expression to a {@link Cast} expression
* @return Cast expression
*/
Cast asCast();
/**
* Returns true if the expression is a edm:Collection expression
* @return true if the expression is a edm:Collection expression
* @return true if the expression is a edm:Collection expression
*/
boolean isCollection();
/**
* Casts the expression to a {@link Collection} expression
* @return Collection expression
*/
Collection asCollection();
/**
* Returns true if the expression is a edm:If expression
* @return true if the expression is a edm:If expression
* @return true if the expression is a edm:If expression
*/
boolean isIf();
/**
* Casts the expression to a {@link If} expression
* @return If expression
*/
If asIf();
/**
* Returns true if the expression is a edm:IsOf expression
* @return true if the expression is a edm:IsOf expression
* @return true if the expression is a edm:IsOf expression
*/
boolean isIsOf();
/**
* Casts the expression to a {@link IsOf} expression
* @return IsOf expression
*/
IsOf asIsOf();
/**
* Returns true if the expression is a edm:LabeledElement expression
* @return true if the expression is a edm:LabeledElement expression
* @return true if the expression is a edm:LabeledElement expression
*/
boolean isLabeledElement();
/**
* Casts the expression to a {@link LabeledElement} expression
* @return LabeledElement expression
*/
LabeledElement asLabeledElement();
/**
* Returns true if the expression is a edm:LabeledElementReference expression
* @return true if the expression is a edm:LabeledElementReference expression
* @return true if the expression is a edm:LabeledElementReference expression
*/
boolean isLabeledElementReference();
/**
* Casts the expression to a {@link LabeledElementReference} expression
* @return LabeledElementReference expression
*/
LabeledElementReference asLabeledElementReference();
/**
* Returns true if the expression is a edm:Null expression
* @return true if the expression is a edm:Null expression
* @return true if the expression is a edm:Null expression
*/
boolean isNull();
/**
* Casts the expression to a {@link Null} expression
* @return Null expression
*/
Null asNull();
/**
* Returns true if the expression is a edm:NavigationPropertyPath expression
* @return true if the expression is a edm:NavigationPropertyPath expression
* @return true if the expression is a edm:NavigationPropertyPath expression
*/
boolean isNavigationPropertyPath();
/**
* Casts the expression to a {@link NavigationPropertyPath} expression
* @return NavigationPropertyPath expression
*/
NavigationPropertyPath asNavigationPropertyPath();
/**
* Returns true if the expression is a edm:Path expression
* @return true if the expression is a edm:Path expression
* @return true if the expression is a edm:Path expression
*/
boolean isPath();
/**
* Casts the expression to a {@link Path} expression
* @return Path expression
*/
Path asPath();
/**
* Returns true if the expression is a edm:PropertyPath expression
* @return true if the expression is a edm:PropertyPath expression
* @return true if the expression is a edm:PropertyPath expression
*/
boolean isPropertyPath();
/**
* Casts the expression to a {@link PropertyPath} expression
* @return PropertyPath expression
*/
PropertyPath asPropertyPath();
/**
* Returns true if the expression is a edm:PropertyValue expression
* @return true if the expression is a edm:PropertyValue expression
* @return true if the expression is a edm:PropertyValue expression
*/
boolean isPropertyValue();
@ -213,13 +213,13 @@ public interface DynamicAnnotationExpression extends AnnotationExpression {
* @return PropertyValue expression
*/
PropertyValue asPropertyValue();
/**
* Returns true if the expression is a edm:Record expression
* @return true if the expression is a edm:Record expression
* @return true if the expression is a edm:Record expression
*/
boolean isRecord();
/**
* Casts the expression to a {@link Record} expression
* @return Record expression
@ -228,10 +228,10 @@ public interface DynamicAnnotationExpression extends AnnotationExpression {
/**
* Returns true if the expression is a edm:UrlRef expression
* @return true if the expression is a edm:UrlRef expression
* @return true if the expression is a edm:UrlRef expression
*/
boolean isUrlRef();
/**
* Casts the expression to a {@link UrlRef} expression
* @return UrlRef expression

View File

@ -28,7 +28,7 @@ public interface If extends DynamicAnnotationExpression, CsdlAnnotatable {
/**
* Returns the first expression of the edm:If expression.
* This expression represents the condition of the if expression
*
*
* @return First expression of the if expression
*/
AnnotationExpression getGuard();
@ -37,16 +37,16 @@ public interface If extends DynamicAnnotationExpression, CsdlAnnotatable {
* Return the second expression of the edm:If expression.
* If the condition of the condition is evaluated to true,
* this expression as to be executed.
*
*
* @return Second Expression of the edm:If expression
*/
AnnotationExpression getThen();
/**
* Return the third expression of the edm:If expression.
* If the condition of the condition is evaluated to false,
* this expression as to be executed.
*
*
* @return Third Expression of the edm:If expression
*/
AnnotationExpression getElse();

View File

@ -26,37 +26,37 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
* the child expression returns the specified type
*/
public interface IsOf extends DynamicAnnotationExpression, CsdlAnnotatable {
/**
* Facet MaxLength
* @return fact MaxLength
*/
Integer getMaxLength();
/**
* Facet Precision
* @return fact Precision
*/
Integer getPrecision();
/**
* Facet Scale
* @return facet Scale
*/
Integer getScale();
/**
* Facet SRID
* @return facet SRID
*/
SRID getSrid();
/**
* The type which is checked again the child expression
* @return EdmType
* @return EdmType type
*/
String getType();
/**
* Returns true if the child expression returns the specified typed
* @return Returns true if the child expression returns the specified typed

View File

@ -25,16 +25,16 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
* then be reused elsewhere with an edm:LabeledElementReference (See {@link LabeledElementReference}) expression.
*/
public interface LabeledElement extends DynamicAnnotationExpression, CsdlAnnotatable {
/**
* Returns the assigned name
* @return assigned name
*/
String getName();
/**
* Returns the child expression
*
*
* @return child expression
*/
DynamicAnnotationExpression getValue();

View File

@ -23,7 +23,7 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
* edm:LabeledElement (see {@link LabeledElement}) expression.
*/
public interface LabeledElementReference extends DynamicAnnotationExpression {
/**
* Returns the value of the edm:LabeledElement expression
* @return value of the edm:LabeledElement expression

View File

@ -25,7 +25,7 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
public interface NavigationPropertyPath extends DynamicAnnotationExpression {
/**
* Returns the navigation property path itself.
*
*
* @return navigation property
*/
String getValue();

View File

@ -22,10 +22,10 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
* Represents a logical edm:Le expression
*/
public interface Not extends DynamicAnnotationExpression {
/**
* Returns a boolean value
* @return either true or false
*/
* Returns a boolean value
* @return either true or false
*/
DynamicAnnotationExpression getExpression();
}

View File

@ -27,7 +27,7 @@ public interface Path extends DynamicAnnotationExpression {
/**
* Returns the target value of the expression
*
*
* @return target value of the expression
*/
String getValue();

View File

@ -26,13 +26,13 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
* edm:Record expression (See {@link EdmRecord}). The value is obtained by evaluating an expression.
*/
public interface PropertyValue extends DynamicAnnotationExpression, CsdlAnnotatable {
/**
* Property name
* @return Property name
*/
String getProperty();
/**
* Evaluated value of the expression (property value)
* @return evaluated value of the expression

View File

@ -27,13 +27,13 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
* A record expression contains zero or more edm:PropertyValue (See {@link Record} )elements.
*/
public interface Record extends DynamicAnnotationExpression, CsdlAnnotatable {
/**
* List of edm:PropertyValues (See {@link PropertyValue}
* @return List of edm:PropertyValues (See {@link PropertyValue}
* @return List of edm:PropertyValues (See
*/
List<PropertyValue> getPropertyValues();
/**
* Returns the entity type or complex type to be constructed.
* @return Entity type or complex type

View File

@ -59,11 +59,11 @@ public interface TwoParamsOpDynamicAnnotationExpression extends DynamicAnnotatio
* Less or equals than
*/
Le;
/**
* Creates the type(Operator) of a expressin
* @param value Value of the operator like "And" or "Eq"
* @return Type(Operator) of the expression
* @return Type(Operator) of the expression
*/
public static Type fromString(final String value) {
Type result = null;
@ -75,19 +75,19 @@ public interface TwoParamsOpDynamicAnnotationExpression extends DynamicAnnotatio
return result;
}
}
/**
* Returns the type of the expression result
* @return Type of the result
*/
Type getType();
/**
* Returns the first expression (left child)
* @return Child expression
*/
DynamicAnnotationExpression getLeftExpression();
/**
* Returns the second expression (right child)
* @return Child expression

View File

@ -23,7 +23,7 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
* the UrlRef expression.
*/
public interface UrlRef extends DynamicAnnotationExpression {
/**
* Returns a expression of type Edm.String
* @return expression of type Edm.String

View File

@ -44,7 +44,7 @@ public class ODataError {
/**
* The value for the code name/value pair is a language-independent string. Its value is a service-defined error code.
* This code serves as a sub-status for the HTTP error code specified in the response. MAY be null.
* @param code
* @param code the service defined error code for this error
* @return this for method chaining
*/
public ODataError setCode(final String code) {
@ -64,7 +64,7 @@ public class ODataError {
/**
* The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error.
* MUST not be null
* @param message
* @param message message for this error
* @return this for method chaining
*/
public ODataError setMessage(final String message) {
@ -84,7 +84,7 @@ public class ODataError {
/**
* The value for the target name/value pair is the target of the particular error (for example, the name of the
* property in error). MAY be null.
* @param target
* @param target target to which this error is related to
* @return this for method chaining
*/
public ODataError setTarget(final String target) {

View File

@ -362,7 +362,7 @@ public class EdmProviderImpl extends AbstractEdm {
@Override
protected List<EdmAnnotation> createAnnotations(final FullQualifiedName annotatedName) {
try {
CsdlAnnotatable providerAnnotatable = provider.getAnnoatatable(annotatedName);
CsdlAnnotatable providerAnnotatable = provider.getAnnotatable(annotatedName);
if (providerAnnotatable != null && providerAnnotatable.getAnnotations() != null) {
List<EdmAnnotation> result = new ArrayList<EdmAnnotation>();
for (CsdlAnnotation annotation : providerAnnotatable.getAnnotations()) {

View File

@ -309,7 +309,7 @@ public class SchemaBasedEdmProvider implements CsdlEdmProvider {
}
@Override
public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException {
public CsdlAnnotatable getAnnotatable(FullQualifiedName annotatedName) throws ODataException {
return null;
}
}