[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 @Override
public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException { public CsdlAnnotatable getAnnotatable(FullQualifiedName annotatedName) throws ODataException {
final CsdlSchema schema = xmlSchemas.get(annotatedName.getNamespace()); final CsdlSchema schema = xmlSchemas.get(annotatedName.getNamespace());
if (schema != null) { if (schema != null) {
return schema.getAnnotatables().get(annotatedName.getName()); return schema.getAnnotatables().get(annotatedName.getName());

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,7 +26,9 @@ import java.util.List;
public interface EdmEnumType extends EdmPrimitiveType, EdmAnnotationsTarget { 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 * @return {@link EdmMember} for the given name
*/ */
EdmMember getMember(String name); EdmMember getMember(String name);

View File

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

View File

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

View File

@ -30,7 +30,7 @@ public interface EdmStructuredType extends EdmType, EdmAnnotationsTarget, EdmAnn
/** /**
* Get property by name * Get property by name
* *
* @param name * @param name name of property
* @return simple, complex or navigation property as {@link EdmTyped} * @return simple, complex or navigation property as {@link EdmTyped}
*/ */
EdmElement getProperty(String name); EdmElement getProperty(String name);
@ -45,7 +45,7 @@ public interface EdmStructuredType extends EdmType, EdmAnnotationsTarget, EdmAnn
/** /**
* Get structural property by name. * Get structural property by name.
* *
* @param name * @param name name of structural property
* @return simple or complex property as {@link EdmTyped} * @return simple or complex property as {@link EdmTyped}
*/ */
EdmProperty getStructuralProperty(String name); EdmProperty getStructuralProperty(String name);
@ -53,7 +53,7 @@ public interface EdmStructuredType extends EdmType, EdmAnnotationsTarget, EdmAnn
/** /**
* Get navigation property by name. * Get navigation property by name.
* *
* @param name * @param name name of navigation property
* @return navigation property as {@link EdmTyped} * @return navigation property as {@link EdmTyped}
*/ */
EdmNavigationProperty getNavigationProperty(String name); 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} * 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) * @return true if this type is compatible to the testType (i.e., this type is a subtype of targetType)
*/ */
boolean compatibleTo(EdmType targetType); boolean compatibleTo(EdmType targetType);

View File

@ -34,8 +34,9 @@ public final class FullQualifiedName implements Serializable {
private final String fqn; private final String fqn;
/** /**
* @param namespace * Create the FQN with given namespace and name
* @param name * @param namespace namespace of FQN
* @param name name of FQN
*/ */
public FullQualifiedName(final String namespace, final String name) { public FullQualifiedName(final String namespace, final String name) {
this.namespace = namespace; 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) { public FullQualifiedName(final String namespaceAndName) {
final int dotIdx = namespaceAndName.lastIndexOf('.'); 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 firstValue first value which is compared
* @param comparedTo * @param secondValue second value which is compared
* @return <code>true</code> if actual is bigger than comparedTo * @return <code>true</code> if firstValue is bigger than secondValue
*/ */
public static boolean isBiggerThan(final String actual, final String comparedTo) { public static boolean isBiggerThan(final String firstValue, final String secondValue) {
if (!validateDataServiceVersion(comparedTo) || !validateDataServiceVersion(actual)) { if (!validateDataServiceVersion(secondValue) || !validateDataServiceVersion(firstValue)) {
throw new IllegalArgumentException("Illegal arguments: " + comparedTo + " and " + actual); throw new IllegalArgumentException("Illegal arguments: " + secondValue + " and " + firstValue);
} }
final double me = Double.parseDouble(extractDataServiceVersionString(actual)); final double me = Double.parseDouble(extractDataServiceVersionString(firstValue));
final double other = Double.parseDouble(extractDataServiceVersionString(comparedTo)); final double other = Double.parseDouble(extractDataServiceVersionString(secondValue));
return me > other; 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) { private static String extractDataServiceVersionString(final String rawDataServiceVersion) {
if (rawDataServiceVersion != null) { if (rawDataServiceVersion != null) {
final String[] pattern = rawDataServiceVersion.split(";"); final String[] pattern = rawDataServiceVersion.split(";");

View File

@ -35,11 +35,25 @@ public abstract class CsdlAbstractEdmItem implements Serializable {
private static final long serialVersionUID = 241190986363884784L; 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) { protected <T extends CsdlNamed> T getOneByName(final String name, final Collection<T> items) {
final List<T> result = getAllByName(name, items); final List<T> result = getAllByName(name, items);
return result.isEmpty() ? null : result.get(0); 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) { protected <T extends CsdlNamed> List<T> getAllByName(final String name, final Collection<T> items) {
final List<T> result = new ArrayList<T>(); final List<T> result = new ArrayList<T>();
for (T type : items) { for (T type : items) {

View File

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

View File

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

View File

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

View File

@ -56,7 +56,7 @@ public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatab
/** /**
* Returns the annotated term * Returns the annotated term
* @return Term * @return Term term
*/ */
public String getTerm() { public String getTerm() {
return term; return term;

View File

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

View File

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

View File

@ -22,6 +22,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl complex type.
*/
public class CsdlComplexType extends CsdlStructuralType { public class CsdlComplexType extends CsdlStructuralType {
private static final long serialVersionUID = 1089771609327713928L; 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.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName; 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 * This method should return an {@link CsdlEnumType} or <b>null</b> if nothing is found
* *
* @param enumTypeName * @param enumTypeName full qualified name of enum type
* @return {@link CsdlEnumType} for given name * @return for given name
* @throws ODataException * @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 * This method should return an {@link CsdlTypeDefinition} or <b>null</b> if nothing is found
* *
* @param typeDefinitionName * @param typeDefinitionName full qualified name of type definition
* @return {@link CsdlTypeDefinition} for given name * @return for given name
* @throws ODataException * @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 * This method should return an {@link CsdlEntityType} or <b>null</b> if nothing is found
* *
* @param entityTypeName * @param entityTypeName full qualified name of entity type
* @return {@link CsdlEntityType} for the given name * @return for the given name
* @throws ODataException * @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. * This method should return a {@link CsdlComplexType} or <b>null</b> if nothing is found.
* *
* @param complexTypeName * @param complexTypeName full qualified name of complex type
* @return {@link CsdlComplexType} for the given name * @return for the given name
* @throws ODataException * @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 * This method should return a list of all {@link CsdlAction} for the FullQualifiedname
* or <b>null</b> if nothing is found * or <b>null</b> if nothing is found
* *
* @param actionName * @param actionName full qualified name of action
* @return List of {@link CsdlAction} or null * @return List of
* @throws ODataException * 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 * This method should return a list of all {@link CsdlFunction} for the FullQualifiedname or <b>null</b> if nothing is
* found * found
* *
* @param functionName * @param functionName full qualified name of function
* @return List of {@link CsdlFunction} or null * @return List of
* @throws ODataException * 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. * 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 * @param termName the name of the Term
* @return {@link CsdlTerm} or null * @return or null
* @throws ODataException * @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 * This method should return an {@link CsdlEntitySet} or <b>null</b> if nothing is found
* *
* @param entityContainer this EntitySet is contained in * @param entityContainer this EntitySet is contained in
* @param entitySetName * @param entitySetName name of entity set
* @return {@link CsdlEntitySet} for the given container and entityset name * @return for the given container and entityset name
* @throws ODataException * @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; throws ODataException;
/** /**
* This method should return an {@link CsdlSingleton} or <b>null</b> if nothing is found * This method should return an {@link CsdlSingleton} or <b>null</b> if nothing is found
* *
* @param entityContainer this Singleton is contained in * @param entityContainer this Singleton is contained in
* @param singletonName * @param singletonName name of singleton
* @return {@link CsdlSingleton} for given container and singleton name * @return for given container and singleton name
* @throws ODataException * @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; throws ODataException;
/** /**
* This method should return an {@link CsdlActionImport} or <b>null</b> if nothing is found * This method should return an {@link CsdlActionImport} or <b>null</b> if nothing is found
* *
* @param entityContainer this ActionImport is contained in * @param entityContainer this ActionImport is contained in
* @param actionImportName * @param actionImportName name of action import
* @return {@link CsdlActionImport} for the given container and ActionImport name * @return for the given container and ActionImport name
* @throws ODataException * @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; throws ODataException;
/** /**
* This method should return a {@link CsdlFunctionImport} or <b>null</b> if nothing is found * This method should return a {@link CsdlFunctionImport} or <b>null</b> if nothing is found
* *
* @param entityContainer this FunctionImport is contained in * @param entityContainer this FunctionImport is contained in
* @param functionImportName * @param functionImportName name of function import
* @return {@link CsdlFunctionImport} for the given container name and function import name * @return for the given container name and function import name
* @throws ODataException * @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; throws ODataException;
/** /**
* This method should return an {@link CsdlEntityContainerInfo} or <b>null</b> if nothing is found * This method should return an {@link CsdlEntityContainerInfo} or <b>null</b> if nothing is found
* *
* @param entityContainerName (null for default container) * @param entityContainerName (null for default container)
* @return {@link CsdlEntityContainerInfo} for the given name * @return for the given name
* @throws ODataException * @throws ODataException the o data exception
*/ */
public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName)
throws ODataException; throws ODataException;
/** /**
* This method should return a list of all namespaces which have an alias * This method should return a list of all namespaces which have an alias
* *
* @return List of alias info * @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} * This method should return a collection of all {@link CsdlSchema}
* *
* @return List<{@link CsdlSchema}> * @return List of
* @throws ODataException * @throws ODataException the o data exception
*/ */
public List<CsdlSchema> getSchemas() throws ODataException; List<CsdlSchema> getSchemas() throws ODataException;
/** /**
* Returns the entity container of this edm * 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 * Gets annotations group.
* @return {@link CsdlAnnotations} group for the given Target *
* @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 * Gets annotatable.
* @return Annotatble element by target name *
* @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; import org.apache.olingo.commons.api.edm.FullQualifiedName;
/**
* The type Csdl entity container.
*/
public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = 5384682515007129458L; private static final long serialVersionUID = 5384682515007129458L;
@ -47,11 +50,22 @@ public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlName
return name; return name;
} }
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlEntityContainer setName(final String name) { public CsdlEntityContainer setName(final String name) {
this.name = name; this.name = name;
return this; return this;
} }
/**
* Gets extends container.
*
* @return the extends container
*/
public String getExtendsContainer() { public String getExtendsContainer() {
if (extendsContainer != null) { if (extendsContainer != null) {
return extendsContainer.getFullQualifiedNameAsString(); return extendsContainer.getFullQualifiedNameAsString();
@ -59,28 +73,61 @@ public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlName
return null; return null;
} }
/**
* Gets extends container fQN.
*
* @return the extends container fQN
*/
public FullQualifiedName getExtendsContainerFQN() { public FullQualifiedName getExtendsContainerFQN() {
return extendsContainer; return extendsContainer;
} }
/**
* Sets extends container.
*
* @param extendsContainer the extends container
* @return the extends container
*/
public CsdlEntityContainer setExtendsContainer(final String extendsContainer) { public CsdlEntityContainer setExtendsContainer(final String extendsContainer) {
this.extendsContainer = new FullQualifiedName(extendsContainer); this.extendsContainer = new FullQualifiedName(extendsContainer);
return this; return this;
} }
/**
* Gets entity sets.
*
* @return the entity sets
*/
public List<CsdlEntitySet> getEntitySets() { public List<CsdlEntitySet> getEntitySets() {
return entitySets; return entitySets;
} }
/**
* Gets entity set.
*
* @param name the name
* @return the entity set
*/
public CsdlEntitySet getEntitySet(final String name) { public CsdlEntitySet getEntitySet(final String name) {
return getOneByName(name, getEntitySets()); return getOneByName(name, getEntitySets());
} }
/**
* Sets entity sets.
*
* @param entitySets the entity sets
* @return the entity sets
*/
public CsdlEntityContainer setEntitySets(final List<CsdlEntitySet> entitySets) { public CsdlEntityContainer setEntitySets(final List<CsdlEntitySet> entitySets) {
this.entitySets = entitySets; this.entitySets = entitySets;
return this; return this;
} }
/**
* Gets action imports.
*
* @return the action imports
*/
public List<CsdlActionImport> getActionImports() { public List<CsdlActionImport> getActionImports() {
return actionImports; return actionImports;
} }
@ -105,11 +152,22 @@ public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlName
return getAllByName(name, getActionImports()); return getAllByName(name, getActionImports());
} }
/**
* Sets action imports.
*
* @param actionImports the action imports
* @return the action imports
*/
public CsdlEntityContainer setActionImports(final List<CsdlActionImport> actionImports) { public CsdlEntityContainer setActionImports(final List<CsdlActionImport> actionImports) {
this.actionImports = actionImports; this.actionImports = actionImports;
return this; return this;
} }
/**
* Gets function imports.
*
* @return the function imports
*/
public List<CsdlFunctionImport> getFunctionImports() { public List<CsdlFunctionImport> getFunctionImports() {
return functionImports; return functionImports;
} }
@ -134,19 +192,42 @@ public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlName
return getAllByName(name, getFunctionImports()); return getAllByName(name, getFunctionImports());
} }
/**
* Sets function imports.
*
* @param functionImports the function imports
* @return the function imports
*/
public CsdlEntityContainer setFunctionImports(final List<CsdlFunctionImport> functionImports) { public CsdlEntityContainer setFunctionImports(final List<CsdlFunctionImport> functionImports) {
this.functionImports = functionImports; this.functionImports = functionImports;
return this; return this;
} }
/**
* Gets singletons.
*
* @return the singletons
*/
public List<CsdlSingleton> getSingletons() { public List<CsdlSingleton> getSingletons() {
return singletons; return singletons;
} }
/**
* Gets singleton.
*
* @param name the name
* @return the singleton
*/
public CsdlSingleton getSingleton(final String name) { public CsdlSingleton getSingleton(final String name) {
return getOneByName(name, getSingletons()); return getOneByName(name, getSingletons());
} }
/**
* Sets singletons.
*
* @param singletons the singletons
* @return the singletons
*/
public CsdlEntityContainer setSingletons(final List<CsdlSingleton> singletons) { public CsdlEntityContainer setSingletons(final List<CsdlSingleton> singletons) {
this.singletons = singletons; this.singletons = singletons;
return this; return this;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,12 +21,24 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
* The type Csdl operation import.
*/
public abstract class CsdlOperationImport extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { public abstract class CsdlOperationImport extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -8928186067970681061L; private static final long serialVersionUID = -8928186067970681061L;
/**
* The Name.
*/
protected String name; protected String name;
/**
* The Entity set.
*/
protected String entitySet; protected String entitySet;
/**
* The Annotations.
*/
protected final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); protected final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
@Override @Override
@ -34,15 +46,32 @@ public abstract class CsdlOperationImport extends CsdlAbstractEdmItem implements
return name; return name;
} }
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlOperationImport setName(final String name) { public CsdlOperationImport setName(final String name) {
this.name = name; this.name = name;
return this; return this;
} }
/**
* Gets entity set.
*
* @return the entity set
*/
public String getEntitySet() { public String getEntitySet() {
return entitySet; return entitySet;
} }
/**
* Sets entity set.
*
* @param entitySet the entity set
* @return the entity set
*/
public CsdlOperationImport setEntitySet(final String entitySet) { public CsdlOperationImport setEntitySet(final String entitySet) {
this.entitySet = entitySet; this.entitySet = entitySet;
return this; 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.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID; import org.apache.olingo.commons.api.edm.geo.SRID;
/**
* The type Csdl parameter.
*/
public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -7360900923880732015L; private static final long serialVersionUID = -7360900923880732015L;
@ -54,78 +57,172 @@ public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, Csd
return name; return name;
} }
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlParameter setName(final String name) { public CsdlParameter setName(final String name) {
this.name = name; this.name = name;
return this; return this;
} }
/**
* Gets type.
*
* @return the type
*/
public String getType() { public String getType() {
return type.getFullQualifiedNameAsString(); return type.getFullQualifiedNameAsString();
} }
/**
* Gets type fQN.
*
* @return the type fQN
*/
public FullQualifiedName getTypeFQN() { public FullQualifiedName getTypeFQN() {
return type; return type;
} }
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlParameter setType(final String type) { public CsdlParameter setType(final String type) {
this.type = new FullQualifiedName(type); this.type = new FullQualifiedName(type);
return this; return this;
} }
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlParameter setType(final FullQualifiedName type) { public CsdlParameter setType(final FullQualifiedName type) {
this.type = type; this.type = type;
return this; return this;
} }
/**
* Is collection.
*
* @return the boolean
*/
public boolean isCollection() { public boolean isCollection() {
return isCollection; return isCollection;
} }
/**
* Sets collection.
*
* @param isCollection the is collection
* @return the collection
*/
public CsdlParameter setCollection(final boolean isCollection) { public CsdlParameter setCollection(final boolean isCollection) {
this.isCollection = isCollection; this.isCollection = isCollection;
return this; return this;
} }
/**
* Is nullable.
*
* @return the boolean
*/
public boolean isNullable() { public boolean isNullable() {
return nullable; return nullable;
} }
/**
* Sets nullable.
*
* @param nullable the nullable
* @return the nullable
*/
public CsdlParameter setNullable(final boolean nullable) { public CsdlParameter setNullable(final boolean nullable) {
this.nullable = nullable; this.nullable = nullable;
return this; return this;
} }
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() { public Integer getMaxLength() {
return maxLength; return maxLength;
} }
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlParameter setMaxLength(final Integer maxLength) { public CsdlParameter setMaxLength(final Integer maxLength) {
this.maxLength = maxLength; this.maxLength = maxLength;
return this; return this;
} }
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() { public Integer getPrecision() {
return precision; return precision;
} }
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlParameter setPrecision(final Integer precision) { public CsdlParameter setPrecision(final Integer precision) {
this.precision = precision; this.precision = precision;
return this; return this;
} }
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() { public Integer getScale() {
return scale; return scale;
} }
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlParameter setScale(final Integer scale) { public CsdlParameter setScale(final Integer scale) {
this.scale = scale; this.scale = scale;
return this; return this;
} }
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() { public SRID getSrid() {
return srid; return srid;
} }
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlParameter setSrid(final SRID srid) { public CsdlParameter setSrid(final SRID srid) {
this.srid = srid; this.srid = srid;
return this; return this;
@ -136,10 +233,21 @@ public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, Csd
return annotations; return annotations;
} }
/**
* Gets mapping.
*
* @return the mapping
*/
public CsdlMapping getMapping() { public CsdlMapping getMapping() {
return mapping; return mapping;
} }
/**
* Sets mapping.
*
* @param mapping the mapping
* @return the mapping
*/
public CsdlParameter setMapping(final CsdlMapping mapping) { public CsdlParameter setMapping(final CsdlMapping mapping) {
this.mapping = mapping; this.mapping = mapping;
return this; 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.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID; import org.apache.olingo.commons.api.edm.geo.SRID;
/**
* The type Csdl property.
*/
public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = -4224390853690843450L; private static final long serialVersionUID = -4224390853690843450L;
@ -60,105 +63,232 @@ public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, Csdl
return name; return name;
} }
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlProperty setName(final String name) { public CsdlProperty setName(final String name) {
this.name = name; this.name = name;
return this; return this;
} }
/**
* Gets type.
*
* @return the type
*/
public String getType() { public String getType() {
return type; return type;
} }
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlProperty setType(final String type) { public CsdlProperty setType(final String type) {
this.type = type; this.type = type;
return this; return this;
} }
/**
* Gets type as fQN object.
*
* @return the type as fQN object
*/
public FullQualifiedName getTypeAsFQNObject() { public FullQualifiedName getTypeAsFQNObject() {
return new FullQualifiedName(type); return new FullQualifiedName(type);
} }
/**
* Sets type.
*
* @param fqnName the fqn name
* @return the type
*/
public CsdlProperty setType(final FullQualifiedName fqnName) { public CsdlProperty setType(final FullQualifiedName fqnName) {
type = fqnName.getFullQualifiedNameAsString(); type = fqnName.getFullQualifiedNameAsString();
return this; return this;
} }
/**
* Is collection.
*
* @return the boolean
*/
public boolean isCollection() { public boolean isCollection() {
return collection; return collection;
} }
/**
* Sets collection.
*
* @param isCollection the is collection
* @return the collection
*/
public CsdlProperty setCollection(final boolean isCollection) { public CsdlProperty setCollection(final boolean isCollection) {
collection = isCollection; collection = isCollection;
return this; return this;
} }
/**
* Gets default value.
*
* @return the default value
*/
public String getDefaultValue() { public String getDefaultValue() {
return defaultValue; return defaultValue;
} }
/**
* Sets default value.
*
* @param defaultValue the default value
* @return the default value
*/
public CsdlProperty setDefaultValue(final String defaultValue) { public CsdlProperty setDefaultValue(final String defaultValue) {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
return this; return this;
} }
/**
* Is nullable.
*
* @return the boolean
*/
public boolean isNullable() { public boolean isNullable() {
return nullable; return nullable;
} }
/**
* Sets nullable.
*
* @param nullable the nullable
* @return the nullable
*/
public CsdlProperty setNullable(final boolean nullable) { public CsdlProperty setNullable(final boolean nullable) {
this.nullable = nullable; this.nullable = nullable;
return this; return this;
} }
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() { public Integer getMaxLength() {
return maxLength; return maxLength;
} }
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlProperty setMaxLength(final Integer maxLength) { public CsdlProperty setMaxLength(final Integer maxLength) {
this.maxLength = maxLength; this.maxLength = maxLength;
return this; return this;
} }
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() { public Integer getPrecision() {
return precision; return precision;
} }
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlProperty setPrecision(final Integer precision) { public CsdlProperty setPrecision(final Integer precision) {
this.precision = precision; this.precision = precision;
return this; return this;
} }
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() { public Integer getScale() {
return scale; return scale;
} }
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlProperty setScale(final Integer scale) { public CsdlProperty setScale(final Integer scale) {
this.scale = scale; this.scale = scale;
return this; return this;
} }
/**
* Is unicode.
*
* @return the boolean
*/
public boolean isUnicode() { public boolean isUnicode() {
return unicode; return unicode;
} }
/**
* Sets unicode.
*
* @param unicode the unicode
* @return the unicode
*/
public CsdlProperty setUnicode(final boolean unicode) { public CsdlProperty setUnicode(final boolean unicode) {
this.unicode = unicode; this.unicode = unicode;
return this; return this;
} }
/**
* Gets mime type.
*
* @return the mime type
*/
public String getMimeType() { public String getMimeType() {
return mimeType; return mimeType;
} }
/**
* Sets mime type.
*
* @param mimeType the mime type
* @return the mime type
*/
public CsdlProperty setMimeType(final String mimeType) { public CsdlProperty setMimeType(final String mimeType) {
this.mimeType = mimeType; this.mimeType = mimeType;
return this; return this;
} }
/**
* Gets mapping.
*
* @return the mapping
*/
public CsdlMapping getMapping() { public CsdlMapping getMapping() {
return mapping; return mapping;
} }
/**
* Sets mapping.
*
* @param mapping the mapping
* @return the mapping
*/
public CsdlProperty setMapping(final CsdlMapping mapping) { public CsdlProperty setMapping(final CsdlMapping mapping) {
this.mapping = mapping; this.mapping = mapping;
return this; return this;
@ -169,11 +299,22 @@ public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, Csdl
return annotations; return annotations;
} }
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlProperty setSrid(final SRID srid) { public CsdlProperty setSrid(final SRID srid) {
this.srid = srid; this.srid = srid;
return this; return this;
} }
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() { public SRID getSrid() {
return srid; return srid;
} }

View File

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

View File

@ -21,6 +21,9 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
* The type Csdl referential constraint.
*/
public class CsdlReferentialConstraint extends CsdlAbstractEdmItem implements CsdlAnnotatable { public class CsdlReferentialConstraint extends CsdlAbstractEdmItem implements CsdlAnnotatable {
private static final long serialVersionUID = -7467707499798840075L; 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>(); private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
/**
* Gets property.
*
* @return the property
*/
public String getProperty() { public String getProperty() {
return property; return property;
} }
/**
* Sets property.
*
* @param property the property
* @return the property
*/
public CsdlReferentialConstraint setProperty(final String property) { public CsdlReferentialConstraint setProperty(final String property) {
this.property = property; this.property = property;
return this; return this;
} }
/**
* Gets referenced property.
*
* @return the referenced property
*/
public String getReferencedProperty() { public String getReferencedProperty() {
return referencedProperty; return referencedProperty;
} }
/**
* Sets referenced property.
*
* @param referencedProperty the referenced property
* @return the referenced property
*/
public CsdlReferentialConstraint setReferencedProperty(final String referencedProperty) { public CsdlReferentialConstraint setReferencedProperty(final String referencedProperty) {
this.referencedProperty = referencedProperty; this.referencedProperty = referencedProperty;
return this; 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.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID; import org.apache.olingo.commons.api.edm.geo.SRID;
/**
* The type Csdl return type.
*/
public class CsdlReturnType extends CsdlAbstractEdmItem { public class CsdlReturnType extends CsdlAbstractEdmItem {
private static final long serialVersionUID = 4816954124986010965L; private static final long serialVersionUID = 4816954124986010965L;
@ -40,73 +43,161 @@ public class CsdlReturnType extends CsdlAbstractEdmItem {
private SRID srid; private SRID srid;
/**
* Gets type.
*
* @return the type
*/
public String getType() { public String getType() {
return type.getFullQualifiedNameAsString(); return type.getFullQualifiedNameAsString();
} }
/**
* Gets type fQN.
*
* @return the type fQN
*/
public FullQualifiedName getTypeFQN() { public FullQualifiedName getTypeFQN() {
return type; return type;
} }
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlReturnType setType(final String type) { public CsdlReturnType setType(final String type) {
this.type = new FullQualifiedName(type); this.type = new FullQualifiedName(type);
return this; return this;
} }
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlReturnType setType(final FullQualifiedName type) { public CsdlReturnType setType(final FullQualifiedName type) {
this.type = type; this.type = type;
return this; return this;
} }
/**
* Is collection.
*
* @return the boolean
*/
public boolean isCollection() { public boolean isCollection() {
return isCollection; return isCollection;
} }
/**
* Sets collection.
*
* @param isCollection the is collection
* @return the collection
*/
public CsdlReturnType setCollection(final boolean isCollection) { public CsdlReturnType setCollection(final boolean isCollection) {
this.isCollection = isCollection; this.isCollection = isCollection;
return this; return this;
} }
/**
* Is nullable.
*
* @return the boolean
*/
public boolean isNullable() { public boolean isNullable() {
return nullable; return nullable;
} }
/**
* Sets nullable.
*
* @param nullable the nullable
* @return the nullable
*/
public CsdlReturnType setNullable(final boolean nullable) { public CsdlReturnType setNullable(final boolean nullable) {
this.nullable = nullable; this.nullable = nullable;
return this; return this;
} }
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() { public Integer getMaxLength() {
return maxLength; return maxLength;
} }
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlReturnType setMaxLength(final Integer maxLength) { public CsdlReturnType setMaxLength(final Integer maxLength) {
this.maxLength = maxLength; this.maxLength = maxLength;
return this; return this;
} }
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() { public Integer getPrecision() {
return precision; return precision;
} }
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlReturnType setPrecision(final Integer precision) { public CsdlReturnType setPrecision(final Integer precision) {
this.precision = precision; this.precision = precision;
return this; return this;
} }
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() { public Integer getScale() {
return scale; return scale;
} }
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlReturnType setScale(final Integer scale) { public CsdlReturnType setScale(final Integer scale) {
this.scale = scale; this.scale = scale;
return this; return this;
} }
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() { public SRID getSrid() {
return srid; return srid;
} }
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlReturnType setSrid(final SRID srid) { public CsdlReturnType setSrid(final SRID srid) {
this.srid = srid; this.srid = srid;
return this; return this;

View File

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

View File

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

View File

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

View File

@ -23,6 +23,9 @@ import java.util.List;
import org.apache.olingo.commons.api.edm.geo.SRID; import org.apache.olingo.commons.api.edm.geo.SRID;
/**
* The type Csdl term.
*/
public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = 3843929000407818103L; private static final long serialVersionUID = 3843929000407818103L;
@ -57,87 +60,192 @@ public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnno
return name; return name;
} }
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlTerm setName(final String name) { public CsdlTerm setName(final String name) {
this.name = name; this.name = name;
return this; return this;
} }
/**
* Gets type.
*
* @return the type
*/
public String getType() { public String getType() {
return type; return type;
} }
/**
* Sets type.
*
* @param type the type
* @return the type
*/
public CsdlTerm setType(final String type) { public CsdlTerm setType(final String type) {
this.type = type; this.type = type;
return this; return this;
} }
/**
* Gets base term.
*
* @return the base term
*/
public String getBaseTerm() { public String getBaseTerm() {
return baseTerm; return baseTerm;
} }
/**
* Sets base term.
*
* @param baseTerm the base term
* @return the base term
*/
public CsdlTerm setBaseTerm(final String baseTerm) { public CsdlTerm setBaseTerm(final String baseTerm) {
this.baseTerm = baseTerm; this.baseTerm = baseTerm;
return this; return this;
} }
/**
* Gets applies to.
*
* @return the applies to
*/
public List<String> getAppliesTo() { public List<String> getAppliesTo() {
return appliesTo; return appliesTo;
} }
/**
* Sets applies to.
*
* @param appliesTo the applies to
* @return the applies to
*/
public CsdlTerm setAppliesTo(final List<String> appliesTo) { public CsdlTerm setAppliesTo(final List<String> appliesTo) {
this.appliesTo = appliesTo; this.appliesTo = appliesTo;
return this; return this;
} }
/**
* Is collection.
*
* @return the boolean
*/
public boolean isCollection() { public boolean isCollection() {
return isCollection; return isCollection;
} }
/**
* Sets collection.
*
* @param isCollection the is collection
* @return the collection
*/
public CsdlTerm setCollection(final boolean isCollection) { public CsdlTerm setCollection(final boolean isCollection) {
this.isCollection = isCollection; this.isCollection = isCollection;
return this; return this;
} }
/**
* Gets default value.
*
* @return the default value
*/
public String getDefaultValue() { public String getDefaultValue() {
return defaultValue; return defaultValue;
} }
/**
* Sets default value.
*
* @param defaultValue the default value
* @return the default value
*/
public CsdlTerm setDefaultValue(final String defaultValue) { public CsdlTerm setDefaultValue(final String defaultValue) {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
return this; return this;
} }
/**
* Is nullable.
*
* @return the boolean
*/
public boolean isNullable() { public boolean isNullable() {
return nullable; return nullable;
} }
/**
* Sets nullable.
*
* @param nullable the nullable
* @return the nullable
*/
public CsdlTerm setNullable(final boolean nullable) { public CsdlTerm setNullable(final boolean nullable) {
this.nullable = nullable; this.nullable = nullable;
return this; return this;
} }
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() { public Integer getMaxLength() {
return maxLength; return maxLength;
} }
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlTerm setMaxLength(final Integer maxLength) { public CsdlTerm setMaxLength(final Integer maxLength) {
this.maxLength = maxLength; this.maxLength = maxLength;
return this; return this;
} }
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() { public Integer getPrecision() {
return precision; return precision;
} }
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlTerm setPrecision(final Integer precision) { public CsdlTerm setPrecision(final Integer precision) {
this.precision = precision; this.precision = precision;
return this; return this;
} }
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() { public Integer getScale() {
return scale; return scale;
} }
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlTerm setScale(final Integer scale) { public CsdlTerm setScale(final Integer scale) {
this.scale = scale; this.scale = scale;
return this; return this;
@ -148,15 +256,32 @@ public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnno
return annotations; return annotations;
} }
/**
* Sets annotations.
*
* @param annotations the annotations
* @return the annotations
*/
public CsdlTerm setAnnotations(final List<CsdlAnnotation> annotations) { public CsdlTerm setAnnotations(final List<CsdlAnnotation> annotations) {
this.annotations = annotations; this.annotations = annotations;
return this; return this;
} }
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() { public SRID getSrid() {
return srid; return srid;
} }
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlTerm setSrid(final SRID srid) { public CsdlTerm setSrid(final SRID srid) {
this.srid = srid; this.srid = srid;
return this; 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.FullQualifiedName;
import org.apache.olingo.commons.api.edm.geo.SRID; import org.apache.olingo.commons.api.edm.geo.SRID;
/**
* The type Csdl type definition.
*/
public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable {
private static final long serialVersionUID = 3718980071229613048L; private static final long serialVersionUID = 3718980071229613048L;
@ -50,11 +53,22 @@ public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed
return name; return name;
} }
/**
* Sets name.
*
* @param name the name
* @return the name
*/
public CsdlTypeDefinition setName(final String name) { public CsdlTypeDefinition setName(final String name) {
this.name = name; this.name = name;
return this; return this;
} }
/**
* Gets underlying type.
*
* @return the underlying type
*/
public String getUnderlyingType() { public String getUnderlyingType() {
if (underlyingType != null) { if (underlyingType != null) {
return underlyingType.getFullQualifiedNameAsString(); return underlyingType.getFullQualifiedNameAsString();
@ -62,56 +76,123 @@ public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed
return null; return null;
} }
/**
* Sets underlying type.
*
* @param underlyingType the underlying type
* @return the underlying type
*/
public CsdlTypeDefinition setUnderlyingType(final String underlyingType) { public CsdlTypeDefinition setUnderlyingType(final String underlyingType) {
this.underlyingType = new FullQualifiedName(underlyingType); this.underlyingType = new FullQualifiedName(underlyingType);
return this; return this;
} }
/**
* Sets underlying type.
*
* @param underlyingType the underlying type
* @return the underlying type
*/
public CsdlTypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) { public CsdlTypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) {
this.underlyingType = underlyingType; this.underlyingType = underlyingType;
return this; return this;
} }
/**
* Gets max length.
*
* @return the max length
*/
public Integer getMaxLength() { public Integer getMaxLength() {
return maxLength; return maxLength;
} }
/**
* Sets max length.
*
* @param maxLength the max length
* @return the max length
*/
public CsdlTypeDefinition setMaxLength(final Integer maxLength) { public CsdlTypeDefinition setMaxLength(final Integer maxLength) {
this.maxLength = maxLength; this.maxLength = maxLength;
return this; return this;
} }
/**
* Gets precision.
*
* @return the precision
*/
public Integer getPrecision() { public Integer getPrecision() {
return precision; return precision;
} }
/**
* Sets precision.
*
* @param precision the precision
* @return the precision
*/
public CsdlTypeDefinition setPrecision(final Integer precision) { public CsdlTypeDefinition setPrecision(final Integer precision) {
this.precision = precision; this.precision = precision;
return this; return this;
} }
/**
* Gets scale.
*
* @return the scale
*/
public Integer getScale() { public Integer getScale() {
return scale; return scale;
} }
/**
* Sets scale.
*
* @param scale the scale
* @return the scale
*/
public CsdlTypeDefinition setScale(final Integer scale) { public CsdlTypeDefinition setScale(final Integer scale) {
this.scale = scale; this.scale = scale;
return this; return this;
} }
/**
* Is unicode.
*
* @return the boolean
*/
public boolean isUnicode() { public boolean isUnicode() {
return unicode; return unicode;
} }
/**
* Sets unicode.
*
* @param unicode the unicode
* @return the unicode
*/
public CsdlTypeDefinition setUnicode(final boolean unicode) { public CsdlTypeDefinition setUnicode(final boolean unicode) {
this.unicode = unicode; this.unicode = unicode;
return this; return this;
} }
/**
* Gets srid.
*
* @return the srid
*/
public SRID getSrid() { public SRID getSrid() {
return srid; return srid;
} }
/**
* Sets srid.
*
* @param srid the srid
* @return the srid
*/
public CsdlTypeDefinition setSrid(final SRID srid) { public CsdlTypeDefinition setSrid(final SRID srid) {
this.srid = srid; this.srid = srid;
return this; return this;

View File

@ -34,10 +34,10 @@ public interface Apply extends DynamicAnnotationExpression, CsdlAnnotatable {
* namespace or alias other than odata. Function names qualified with odata are reserved for this specification and * namespace or alias other than odata. Function names qualified with odata are reserved for this specification and
* its future versions. * 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_CONCAT
* @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_FILLURITEMPLATE * @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_FILLURITEMPLATE
* @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_URIENCODE * @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_URIENCODE
* @return function full qualified name
*/ */
String getFunction(); String getFunction();

View File

@ -79,7 +79,7 @@ public interface ConstantAnnotationExpression extends AnnotationExpression {
/** /**
* Creates a new type by a given string e.g. "TimeOfDay" * Creates a new type by a given string e.g. "TimeOfDay"
* @param value Type as string * @param value Type as string
* @return Type * @return Type type
*/ */
public static Type fromString(final String value) { public static Type fromString(final String value) {
Type result = null; Type result = null;
@ -100,7 +100,7 @@ public interface ConstantAnnotationExpression extends AnnotationExpression {
/** /**
* Sets the type of the constant expression * Sets the type of the constant expression
* @param type * @param type type of the constant expression
*/ */
void setType(Type type); void setType(Type type);

View File

@ -54,7 +54,7 @@ public interface DynamicAnnotationExpression extends AnnotationExpression {
/** /**
* Casts the expression as {@link TwoParamsOpDynamicAnnotationExpression} * Casts the expression as {@link TwoParamsOpDynamicAnnotationExpression}
* @return TwoParamsOpDynamicAnnotationExpression * @return TwoParamsOpDynamicAnnotationExpression two params op dynamic annotation expression
*/ */
TwoParamsOpDynamicAnnotationExpression asTwoParamsOp(); TwoParamsOpDynamicAnnotationExpression asTwoParamsOp();

View File

@ -53,7 +53,7 @@ public interface IsOf extends DynamicAnnotationExpression, CsdlAnnotatable {
/** /**
* The type which is checked again the child expression * The type which is checked again the child expression
* @return EdmType * @return EdmType type
*/ */
String getType(); String getType();

View File

@ -30,7 +30,7 @@ public interface Record extends DynamicAnnotationExpression, CsdlAnnotatable {
/** /**
* List of edm:PropertyValues (See {@link PropertyValue} * List of edm:PropertyValues (See {@link PropertyValue}
* @return List of edm:PropertyValues (See {@link PropertyValue} * @return List of edm:PropertyValues (See
*/ */
List<PropertyValue> getPropertyValues(); List<PropertyValue> getPropertyValues();

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. * 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. * 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 * @return this for method chaining
*/ */
public ODataError setCode(final String code) { 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. * The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error.
* MUST not be null * MUST not be null
* @param message * @param message message for this error
* @return this for method chaining * @return this for method chaining
*/ */
public ODataError setMessage(final String message) { 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 * 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. * property in error). MAY be null.
* @param target * @param target target to which this error is related to
* @return this for method chaining * @return this for method chaining
*/ */
public ODataError setTarget(final String target) { public ODataError setTarget(final String target) {

View File

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

View File

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