[OLINGO-63] Uri Parser: Add test cases for key predicates, select,expand and code cleanup

This commit is contained in:
Sven Kobler 2014-01-24 14:05:20 +01:00
parent 757eb54c08
commit 1ef03f92f4
137 changed files with 2504 additions and 1918 deletions

View File

@ -16,28 +16,20 @@
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri.antlr;
package org.apache.olingo.odata4.commons.api.exception;
public class ParserException extends Exception {
/**
*
*/
public class ODataApplicationException extends Exception {
private static final long serialVersionUID = 1L;
public ParserException() {
super();
}
public ParserException(final String msg) {
public ODataApplicationException(final String msg) {
super(msg);
}
public ParserException(final String msg, final Throwable e) {
public ODataApplicationException(final String msg, final Throwable e) {
super(msg, e);
}
public ParserException(final Throwable e) {
public ODataApplicationException(final Throwable e) {
super(e);
}

View File

@ -22,7 +22,9 @@ package org.apache.olingo.odata4.producer.api.uri;
import org.apache.olingo.odata4.producer.api.uri.queryoption.FormatOption;
public interface UriInfoMetadata {
public String getContext();
public FormatOption getFormatOption();
}

View File

@ -30,7 +30,7 @@ import org.apache.olingo.odata4.producer.api.uri.queryoption.OrderByOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SearchOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SelectOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SkipOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SkipTokenOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SkiptokenOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.TopOption;
public interface UriInfoResource {
@ -55,7 +55,7 @@ public interface UriInfoResource {
SkipOption getSkipOption();
SkipTokenOption getSkipTokenOption();
SkiptokenOption getSkipTokenOption();
TopOption getTopOption();

View File

@ -23,8 +23,11 @@ import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Expressi
public interface UriParameter {
public String getAlias();
public String getText();
public Expression getExression();
public String getName();
}

View File

@ -26,7 +26,7 @@ public interface UriResourceAction extends UriResourcePartTyped {
EdmAction getAction();
/**
* Convenience method which return the {@link EdmActionImport} which was used in
* Convenience method which returns the {@link EdmActionImport} which was used in
* the resource path to define the {@link EdmAction}.
* @return
*/

View File

@ -21,6 +21,9 @@ package org.apache.olingo.odata4.producer.api.uri;
import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Expression;
public interface UriResourceAll extends UriResourcePartTyped {
public String getLamdaVariable();
public Expression getExpression();
}

View File

@ -21,6 +21,9 @@ package org.apache.olingo.odata4.producer.api.uri;
import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Expression;
public interface UriResourceAny extends UriResourcePartTyped {
public String getLamdaVariable();
public Expression getExpression();
}

View File

@ -21,6 +21,7 @@ package org.apache.olingo.odata4.producer.api.uri;
import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
public interface UriResourceComplexProperty extends UriResourceProperty {
EdmComplexType getComplexType();
EdmComplexType getComplexTypeFilter();

View File

@ -18,7 +18,6 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri;
public interface UriResourceCount extends UriResourcePart {
}

View File

@ -26,7 +26,6 @@ import org.apache.olingo.odata4.commons.api.edm.EdmType;
public interface UriResourceEntitySet extends UriResourcePartTyped {
EdmEntitySet getEntitySet();
EdmEntityType getEntityType();

View File

@ -26,11 +26,10 @@ import org.apache.olingo.odata4.commons.api.edm.EdmType;
public interface UriResourceFunction extends UriResourcePartTyped {
EdmFunction getFunction();
/**
* Convenience method which return the {@link EdmFunctionImport} which was used in
* Convenience method which returns the {@link EdmFunctionImport} which was used in
* the resource path to define the {@link EdmFunction}.
* @return
*/

View File

@ -22,11 +22,15 @@ import org.apache.olingo.odata4.commons.api.edm.EdmType;
/**
* Class indicating the $it reference. $it may be used within filter to
* refer to the last EDM object reference in the resource path.
* refer to the last EDM object reference in the resource path. Since $it is
* optional in some cases ( e.g. first member expressions) the {@link #isExplicitIt()}
* method can be used to check if $it was explicitly noted in the URI
*/
public interface UriResourceIt extends UriResourcePartTyped {
EdmType getTypeFilterOnCollection();
EdmType getTypeFilterOnEntry();
boolean isExplicitIt();
}

View File

@ -20,7 +20,6 @@
package org.apache.olingo.odata4.producer.api.uri;
public enum UriResourceKind {
action, entitySet, function, it, singleton, navigationProperty,
simpleProperty, complexProperty, value, count, ref, root, lamdaAll, lamdaAny
action, complexProperty, count, entitySet, function, it, lambdaAll, lambdaAny,
lambdaVariable, navigationProperty, ref, root, simpleProperty, singleton, value,
}

View File

@ -1,5 +1,4 @@
/*******************************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -17,20 +16,18 @@
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption;
package org.apache.olingo.odata4.producer.api.uri;
import java.util.List;
import org.apache.olingo.odata4.commons.api.edm.EdmElement;
import org.apache.olingo.odata4.commons.api.edm.EdmType;
public interface ExpandVisitor<T> {
T visitExpandSegment(EdmElement property, EdmType initialType, EdmType finalType);
T visitExpandItem(List<T> expandSegments, boolean isStar, boolean isRef, EdmType finalType);
T visitExpand(List<T> expandItems);
/**
* Class indicating the $it reference. $it may be used within filter to
* refer to the last EDM object reference in the resource path. Since $it is
* optional in some cases ( e.g. first member expressions) the {@link #isExplicitIt()}
* method can be used to check if $it was explicitly noted in the URI
*/
public interface UriResourceLambdaRef extends UriResourcePartTyped {
public String getVariableText();
}

View File

@ -26,8 +26,11 @@ import org.apache.olingo.odata4.commons.api.edm.EdmType;
public interface UriResourceNavigation extends UriResourcePartTyped {
List<UriParameter> getKeyPredicates();
EdmNavigationProperty getNavigationProperty();
EdmType getTypeFilterOnCollection();
EdmType getTypeFilterOnEntry();
}

View File

@ -18,7 +18,11 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri;
public interface UriResourcePart {
UriResourceKind getKind();
@Override
String toString();
}

View File

@ -22,7 +22,9 @@ package org.apache.olingo.odata4.producer.api.uri;
import org.apache.olingo.odata4.commons.api.edm.EdmType;
public interface UriResourcePartTyped extends UriResourcePart {
EdmType getType();
boolean isCollection();
}

View File

@ -21,5 +21,7 @@ package org.apache.olingo.odata4.producer.api.uri;
import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
public interface UriResourceProperty extends UriResourcePartTyped {
EdmProperty getProperty();
}

View File

@ -18,7 +18,6 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri;
public interface UriResourceRef extends UriResourcePart {
}

View File

@ -18,7 +18,6 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri;
public interface UriResourceSimpleProperty extends UriResourceProperty {
}

View File

@ -18,15 +18,15 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri;
import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
import org.apache.olingo.odata4.commons.api.edm.EdmSingleton;
import org.apache.olingo.odata4.commons.api.edm.EdmType;
public interface UriResourceSingleton extends UriResourcePartTyped {
EdmSingleton getSingleton();
EdmEntityType getEntityType();
EdmEntityType getEntityTypeFilter();
}

View File

@ -18,7 +18,6 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri;
public interface UriResourceValue extends UriResourcePart {
}

View File

@ -21,6 +21,7 @@ package org.apache.olingo.odata4.producer.api.uri.queryoption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Expression;
public interface AliasQueryOption extends QueryOption {
public Expression getAliasValue();
}

View File

@ -20,9 +20,6 @@ package org.apache.olingo.odata4.producer.api.uri.queryoption;
public class ExceptionVisitExpand extends Exception {
/**
*
*/
private static final long serialVersionUID = 822365726050299076L;
private static final long serialVersionUID = 1L;
}

View File

@ -18,14 +18,9 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption;
import java.util.List;
import org.apache.olingo.odata4.producer.api.uri.UriResourceProperty;
import org.apache.olingo.odata4.producer.api.uri.UriInfoResource;
public interface ExpandItem {
boolean isStar();
List<UriResourceProperty> getPropertyChainList();
LevelExpandOption getLevel();
@ -44,4 +39,11 @@ public interface ExpandItem {
SelectOption getSelect();
ExpandOption getExpand();
UriInfoResource getPath();
boolean isStar();
boolean isRef();
}

View File

@ -21,5 +21,7 @@ package org.apache.olingo.odata4.producer.api.uri.queryoption;
import java.util.List;
public interface ExpandOption extends SystemQueryOption {
List<ExpandItem> getExpandItems();
}

View File

@ -21,5 +21,6 @@ package org.apache.olingo.odata4.producer.api.uri.queryoption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Expression;
public interface FilterOption extends SystemQueryOption {
Expression getExpression();
}

View File

@ -19,6 +19,7 @@
package org.apache.olingo.odata4.producer.api.uri.queryoption;
public interface FormatOption extends SystemQueryOption {
// TODO select best representation for format
// TODO Select best representation for format
Object getFormat();
}

View File

@ -19,5 +19,7 @@
package org.apache.olingo.odata4.producer.api.uri.queryoption;
public interface IdOption extends SystemQueryOption {
String getIdValue();
}

View File

@ -19,5 +19,7 @@
package org.apache.olingo.odata4.producer.api.uri.queryoption;
public interface InlineCountOption extends SystemQueryOption {
boolean getInlineCountValue();
boolean getvalue();
}

View File

@ -22,6 +22,6 @@ public interface LevelExpandOption {
boolean isMax();
String getLevel();
int getLevel();
}

View File

@ -23,4 +23,5 @@ public interface QueryOption {
public String getName();
public String getText();
}

View File

@ -23,4 +23,5 @@ import org.apache.olingo.odata4.producer.api.uri.queryoption.search.SearchExpres
public interface SearchOption extends SystemQueryOption {
SearchExpression getSearchExpression();
}

View File

@ -35,9 +35,6 @@ public interface SelectItem {
EdmEntityType getEntityTypeCast();
EdmAction getAction();
EdmFunction getFunction();
List<UriResourceProperty> getPropertyChainList();
}

View File

@ -20,6 +20,6 @@ package org.apache.olingo.odata4.producer.api.uri.queryoption;
public interface SkipOption extends SystemQueryOption {
String getSkipValue();
String getValue();
}

View File

@ -1,26 +0,0 @@
/*******************************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption;
public interface SkipTokenOption extends SystemQueryOption{
String getSkipTokenValue();
}

View File

@ -18,3 +18,9 @@
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption;
public interface SkiptokenOption extends SystemQueryOption {
String getValue();
}

View File

@ -18,7 +18,7 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption;
public enum SystemQueryOptionEnum {
public enum SupportedQueryOptions {
FILTER("$filter"),
FORMAT("$format"),
EXPAND("$expand"),
@ -34,7 +34,7 @@ public enum SystemQueryOptionEnum {
String syntax;
private SystemQueryOptionEnum(final String syntax) {
private SupportedQueryOptions(final String syntax) {
this.syntax = syntax;
}

View File

@ -20,6 +20,6 @@ package org.apache.olingo.odata4.producer.api.uri.queryoption;
public interface SystemQueryOption extends QueryOption {
SystemQueryOptionEnum getKind();
SupportedQueryOptions getKind();
}

View File

@ -19,5 +19,7 @@
package org.apache.olingo.odata4.producer.api.uri.queryoption;
public interface TopOption extends SystemQueryOption {
String getTopValue();
}

View File

@ -1,48 +0,0 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption;
/* TODO update documentation*/
public interface VisitableExpand {
/**
* Method {@link #accept(ExpressionVisitor)} is called when traversing the expression tree. This method is invoked on
* each
* expression used as node in an expression tree. The implementations should
* behave as follows:
* <li>Call accept on all sub nodes and store the returned Objects
* <li>Call the appropriate method on the {@link ExpressionVisitor} instance and provide the stored objects to that
* instance
* <li>Return the object which should be passed to the processing algorithm of the parent expression node
* <br>
* <br>
* @param visitor
* Object ( implementing {@link ExpressionVisitor}) whose methods are called during traversing a expression node of
* the expression tree.
* @return
* Object which should be passed to the processing algorithm of the parent expression node
* @throws ExceptionVisitExpression
* Exception occurred the OData library while traversing the tree
* @throws ODataApplicationException
* Exception thrown by the application who implemented the visitor
*/
<T> T accept(ExpandVisitor<T> visitor) throws ExceptionVisitExpand;
}

View File

@ -18,7 +18,7 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
public interface BinaryExpression {
public interface BinaryExpression extends Expression {
public SupportedBinaryOperators getOperator();

View File

@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri.queryoption.expression;
package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
public class ExceptionVisitExpression extends Exception {
/**
*
*/
private static final long serialVersionUID = 822365726050299076L;
private static final long serialVersionUID = 1L;
}

View File

@ -18,6 +18,6 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
public interface Expression {
public interface Expression extends VisitableExression {
}

View File

@ -16,25 +16,37 @@
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri.queryoption.expression;
package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
import java.util.List;
import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.SupportedBinaryOperators;
import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.SupportedMethodCalls;
import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.SupportedUnaryOperators;
import org.apache.olingo.odata4.commons.api.edm.EdmType;
import org.apache.olingo.odata4.commons.api.exception.ODataApplicationException;
import org.apache.olingo.odata4.producer.api.uri.UriInfoResource;
public interface ExpressionVisitor<T> {
T visitBinaryOperator(SupportedBinaryOperators operator, T left, T right) throws ExceptionVisitExpression;
T visitBinaryOperator(SupportedBinaryOperators operator, T left, T right)
throws ExceptionVisitExpression, ODataApplicationException;
T visitUnaryOperator(SupportedUnaryOperators operator, T operand) throws ExceptionVisitExpression;
T visitUnaryOperator(SupportedUnaryOperators operator, T operand)
throws ExceptionVisitExpression, ODataApplicationException;
T visitMethodCall(SupportedMethodCalls methodCall, List<T> parameters) throws ExceptionVisitExpression;
T visitMethodCall(SupportedMethodCalls methodCall, List<T> parameters)
throws ExceptionVisitExpression, ODataApplicationException;
T visitLiteral(String literal) throws ExceptionVisitExpression;
T visitLambdaExpression(String variableText, Expression expression)
throws ExceptionVisitExpression, ODataApplicationException;
T visitLiteral(String literal) throws ExceptionVisitExpression, ODataApplicationException;
T visitMember(UriInfoResource member) throws ExceptionVisitExpression, ODataApplicationException;
T visitAlias(String referenceName) throws ExceptionVisitExpression, ODataApplicationException;
T visitTypeLiteral(EdmType type) throws ExceptionVisitExpression, ODataApplicationException;
T visitLambdaReference(String variableText) throws ExceptionVisitExpression, ODataApplicationException;
T visitMember(MemberImpl member) throws ExceptionVisitExpression;
T visitAlias(String referenceName) throws ExceptionVisitExpression;
}

View File

@ -18,8 +18,8 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
public interface LambdaRef {
public interface LambdaRef extends Expression {
public String getVariableText();
public String getVariableName();
}

View File

@ -18,7 +18,7 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
public interface Literal {
public interface Literal extends Expression {
public String getText();

View File

@ -20,9 +20,7 @@ package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
import org.apache.olingo.odata4.producer.api.uri.UriInfoResource;
public interface Member {
public boolean isIT();
public interface Member extends Expression {
public UriInfoResource getPath();

View File

@ -20,12 +20,10 @@ package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
import java.util.List;
public interface MethodCall {
public interface MethodCall extends Expression {
public SupportedMethodCalls getMethod();
public List<Expression> getParameters();
}

View File

@ -38,7 +38,7 @@ public enum SupportedBinaryOperators {
this.syntax = syntax;
}
public static SupportedBinaryOperators get(String operator) {
public static SupportedBinaryOperators get(final String operator) {
for (SupportedBinaryOperators op : SupportedBinaryOperators.values()) {
if (op.toString().equals(operator)) {
return op;
@ -52,5 +52,4 @@ public enum SupportedBinaryOperators {
return syntax;
}
}

View File

@ -29,8 +29,8 @@ public enum SupportedMethodCalls {
ROUND("round"), FLOOR("floor"),
CEILING("ceiling"),DISTANCE("distance"),GEOLENGTH("geolength"),INTERSECTS("intersects"), CAST("cast"), ISOF("isof");
CEILING("ceiling"), DISTANCE("distance"), GEOLENGTH("geolength"), INTERSECTS("intersects"), CAST("cast"),
ISOF("isof");
private String syntax;
@ -43,7 +43,7 @@ public enum SupportedMethodCalls {
return syntax;
}
public static SupportedMethodCalls get(String operator) {
public static SupportedMethodCalls get(final String operator) {
for (SupportedMethodCalls op : SupportedMethodCalls.values()) {
if (op.toString().equals(operator + '(')) {
return op;

View File

@ -32,7 +32,7 @@ public enum SupportedUnaryOperators {
return syntax;
}
public static SupportedUnaryOperators get(String operator) {
public static SupportedUnaryOperators get(final String operator) {
for (SupportedUnaryOperators op : SupportedUnaryOperators.values()) {
if (op.toString().equals(operator)) {
return op;

View File

@ -20,10 +20,8 @@ package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
import org.apache.olingo.odata4.commons.api.edm.EdmType;
public interface TypeLiteral {
public interface TypeLiteral extends Expression {
public EdmType getType();
}

View File

@ -18,10 +18,10 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
public interface UnaryOperator {
public interface UnaryOperator extends Expression {
public abstract Expression getOperand();
public Expression getOperand();
public abstract SupportedUnaryOperators getOperator();
public SupportedUnaryOperators getOperator();
}

View File

@ -16,39 +16,32 @@
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri.queryoption.expression;
package org.apache.olingo.odata4.producer.api.uri.queryoption.expression;
import org.apache.olingo.odata4.commons.api.exception.ODataApplicationException;
/* TODO update documentation*/
public interface VisitableExression {
/**
* Method {@link #accept(ExpressionVisitor)} is called when traversing the expression tree. This method is invoked on
* each
* expression used as node in an expression tree. The implementations should
* each expression used as node in an expression tree. The implementations should
* behave as follows:
* <li>Call accept on all sub nodes and store the returned Objects
* <li>Call the appropriate method on the {@link ExpressionVisitor} instance and provide the stored objects to that
* instance
* <li>Call accept on all sub nodes and store the returned Objects which are of the generic type T
* <li>Call the appropriate method on the {@link ExpressionVisitor} instance and provide the stored return objects
* to that instance
* <li>Return the object which should be passed to the processing algorithm of the parent expression node
* <br>
* <br>
* @param visitor
* Object ( implementing {@link ExpressionVisitor}) whose methods are called during traversing a expression node of
* the expression tree.
* Object (implementing {@link ExpressionVisitor}) whose methods are called during traversing a
* expression node of the expression tree.
* @return
* Object which should be passed to the processing algorithm of the parent expression node
* Object of type T which should be passed to the processing algorithm of the parent expression node
* @throws ExceptionVisitExpression
* Exception occurred the OData library while traversing the tree
* @throws ODataApplicationException
* Exception thrown by the application who implemented the visitor
*/
<T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression;
}
<T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression, ODataApplicationException;
}

View File

@ -25,4 +25,5 @@ public interface SearchBinary extends SearchExpression {
SearchExpression getLeftOperand();
SearchExpression getRightOperand();
}

View File

@ -19,5 +19,7 @@
package org.apache.olingo.odata4.producer.api.uri.queryoption.search;
public interface SearchTerm extends SearchExpression {
String getSearchTerm();
}

View File

@ -19,5 +19,7 @@
package org.apache.olingo.odata4.producer.api.uri.queryoption.search;
public interface SearchUnary {
SearchExpression getOperand();
}

View File

@ -28,7 +28,12 @@ public enum SupportedSearchBinaryOperators {
this.syntax = syntax;
}
public static SupportedSearchBinaryOperators get(String operator) {
@Override
public String toString() {
return syntax;
}
public static SupportedSearchBinaryOperators get(final String operator) {
for (SupportedSearchBinaryOperators op : SupportedSearchBinaryOperators.values()) {
if (op.toString().equals(operator)) {
return op;
@ -37,8 +42,5 @@ public enum SupportedSearchBinaryOperators {
return null;
}
@Override
public String toString() {
return syntax;
}
}

View File

@ -32,7 +32,7 @@ public enum SupportedSearchUnaryOperators {
return syntax;
}
public static SupportedSearchUnaryOperators get(String operator) {
public static SupportedSearchUnaryOperators get(final String operator) {
for (SupportedSearchUnaryOperators op : SupportedSearchUnaryOperators.values()) {
if (op.toString().equals(operator)) {
return op;

View File

@ -110,7 +110,7 @@ valueOnly : vV=commonExpr ;
nameValueList : WSP* vlNVP+=nameValuePair WSP* ( COMMA WSP* vlNVP+=nameValuePair WSP*)* ;
nameValuePair : vODI=odataIdentifier EQ (AT vALI=odataIdentifier | vCOM=commonExpr /*TODO | val2=enumX*/);
constSegment : SLASH (vV=value | vC=count | vR=ref );
constSegment : SLASH (vV=value | vC=count | vR=ref | vAll=allExpr | vAny=anyExpr);
count : COUNT;
ref : REF;
@ -159,8 +159,10 @@ expand : EXPAND EQ vlEI+=expandItem ( COMMA vlEI+=expandItem )*;
expandItem : vS=STAR ( SLASH vR=ref | OPEN LEVELS EQ ( vL=INT | vM=MAX) CLOSE )?
| vEP=expandPath vEPE=expandPathExtension?;
expandPath : expandPathSegment ( SLASH expandPathSegment )*;
expandPathSegment : vNS=namespace? vODI=odataIdentifier;
expandPath : vlPS+=pathSegment (SLASH vlPS+=pathSegment)*;
//expandPath : expandPathSegment ( SLASH expandPathSegment )*;
//expandPathSegment : vNS=namespace? vODI=odataIdentifier;
expandPathExtension : OPEN vlEO+=expandOption ( SEMI vlEO+=expandOption )* CLOSE
| SLASH vR=ref ( OPEN vlEOR+=expandRefOption ( SEMI vlEOR+=expandRefOption )* CLOSE )?

View File

@ -18,7 +18,6 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.Collections;
@ -34,10 +33,9 @@ import org.antlr.v4.runtime.dfa.DFA;
class ErrorCollector implements ANTLRErrorListener {
private List<Exception> exceptions = new ArrayList<Exception>();
// private ParserValidator tokenValidator;
@Override
public void syntaxError(final Recognizer<?, ?> recognizer, final Object offendingSymbol, final int line,
final int charPositionInLine,
@ -58,17 +56,19 @@ class ErrorCollector implements ANTLRErrorListener {
final BitSet ambigAlts, final ATNConfigSet configs) {
/*
if (tokenValidator.logLevel > 0) {
System.out.println("reportAmbiguity: ");
System.out.println(" ambigAlts: " + ambigAlts);
System.out.println(" configs: " + configs);
System.out.println(" input: " + recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex)));
}*/
* if (tokenValidator.logLevel > 0) {
* System.out.println("reportAmbiguity: ");
* System.out.println(" ambigAlts: " + ambigAlts);
* System.out.println(" configs: " + configs);
* System.out.println(" input: " + recognizer.getTokenStream().getText(Interval.of(startIndex, stopIndex)));
* }
*/
/*
if (!tokenValidator.allowAmbiguity) {
printStack(recognizer);
fail("reportAmbiguity");
}*/
* if (!tokenValidator.allowAmbiguity) {
* printStack(recognizer);
* fail("reportAmbiguity");
* }
*/
}
@Override
@ -76,16 +76,17 @@ class ErrorCollector implements ANTLRErrorListener {
final int stopIndex,
final BitSet conflictingAlts, final ATNConfigSet configs) {
/*
// The grammar should be written in order to avoid attempting a full context parse because its negative
// impact on the performance, so trace and stop here
if (tokenValidator.logLevel > 0) {
System.out.println("allowed AttemptingFullContext");
}
if (!tokenValidator.allowFullContext) {
printStack(recognizer);
fail("reportAttemptingFullContext");
}*/
* // The grammar should be written in order to avoid attempting a full context parse because its negative
* // impact on the performance, so trace and stop here
* if (tokenValidator.logLevel > 0) {
* System.out.println("allowed AttemptingFullContext");
* }
*
* if (!tokenValidator.allowFullContext) {
* printStack(recognizer);
* fail("reportAttemptingFullContext");
* }
*/
}
@Override
@ -93,14 +94,15 @@ class ErrorCollector implements ANTLRErrorListener {
final int stopIndex, final int prediction,
final ATNConfigSet configs) {
/*
if (tokenValidator.logLevel > 0) {
System.out.println("allowed ContextSensitivity");
}
if (!tokenValidator.allowContextSensitifity) {
printStack(recognizer);
fail("reportContextSensitivity");
}*/
* if (tokenValidator.logLevel > 0) {
* System.out.println("allowed ContextSensitivity");
* }
*
* if (!tokenValidator.allowContextSensitifity) {
* printStack(recognizer);
* fail("reportContextSensitivity");
* }
*/
}
/*

View File

@ -1,25 +0,0 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri;
import org.apache.olingo.odata4.producer.core.uri.queryoption.ExpandSegment;
public class ExpandSegmentCount extends ExpandSegment {
}

View File

@ -1,25 +0,0 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri;
import org.apache.olingo.odata4.producer.core.uri.queryoption.ExpandSegment;
public class ExpandSegmentIt extends ExpandSegment {
}

View File

@ -1,25 +0,0 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri;
import org.apache.olingo.odata4.producer.core.uri.queryoption.ExpandSegment;
public class ExpandSegmentRef extends ExpandSegment {
}

View File

@ -29,7 +29,7 @@ import org.apache.olingo.odata4.producer.core.uri.antlr.UriParserParser;
import org.apache.olingo.odata4.producer.core.uri.antlr.UriParserParser.OdataRelativeUriEOFContext;
public class ParserAdapter {
public static UriInfoImpl parseUri(final String input, UriParseTreeVisitor uriParseTreeVisitor)
public static UriInfoImpl parseUri(final String input, final UriParseTreeVisitor uriParseTreeVisitor)
throws UriParserException {
try {
@ -65,7 +65,6 @@ public class ParserAdapter {
// TODO create better error collector
parser.addErrorListener(new ErrorCollector());
// bail out of parser at first syntax error. --> proceeds in catch block with step 2
parser.setErrorHandler(new BailErrorStrategy());

View File

@ -44,21 +44,21 @@ import org.apache.olingo.odata4.producer.api.uri.queryoption.OrderByOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SearchOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SelectOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SkipOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SkipTokenOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SkiptokenOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SupportedQueryOptions;
import org.apache.olingo.odata4.producer.api.uri.queryoption.TopOption;
import org.apache.olingo.odata4.producer.core.uri.queryoption.CustomQueryOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.ExpandOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.FilterOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.FormatOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.IdOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.InlineCountImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.InlineCountOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.OrderByImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.QueryOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.SearchOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.SelectOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.SkipOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.SkipTokenOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.SkiptokenOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.SystemQueryOptionImpl;
import org.apache.olingo.odata4.producer.core.uri.queryoption.TopOptionImpl;
@ -75,21 +75,17 @@ public class UriInfoImpl implements UriInfo {
private FilterOptionImpl filterOption;
private FormatOptionImpl formatOption;
private IdOption idOption;
private InlineCountImpl inlineCountOption;
private InlineCountOptionImpl inlineCountOption;
private OrderByImpl orderByOption;
private SearchOptionImpl searchOption;
private SelectOptionImpl selectOption;
private SkipOptionImpl skipOption;
private SkipTokenOptionImpl skipTokenOption;
private SkiptokenOptionImpl skipTokenOption;
private TopOptionImpl topOption;
private UriResourcePart lastPathPart;
private UriResourcePart lastResourcePart;
private List<UriResourcePart> pathParts = new ArrayList<UriResourcePart>();
public UriInfoImpl(Edm edm) {
// this.edm = edm;
}
@Override
public UriInfoAll asUriInfoAll() {
return this;
@ -125,26 +121,27 @@ public class UriInfoImpl implements UriInfo {
return Collections.unmodifiableList(entitySetNames);
}
public void addEntitySetName(String entitySet) {
public void addEntitySetName(final String entitySet) {
entitySetNames.add(entitySet);
}
@Override
public List<UriResourcePart> getUriResourceParts() {
List<UriResourcePart> returnList = new ArrayList<UriResourcePart>();
for (UriResourcePart part : pathParts) {
returnList.add(part);
for (UriResourcePart item : pathParts) {
returnList.add(item);
}
return Collections.unmodifiableList(returnList);
}
public void addPathInfo(UriResourcePartImpl uriPathInfo) {
public void addPathInfo(final UriResourcePartImpl uriPathInfo) {
pathParts.add(uriPathInfo);
lastPathPart = uriPathInfo;
lastResourcePart = uriPathInfo;
}
@Override
public String getContext() {
// TODO add support for UTI context part
return null;
}
@ -192,13 +189,12 @@ public class UriInfoImpl implements UriInfo {
return kind;
}
public UriResourcePart getLastUriPathInfo() {
return lastPathPart;
public UriResourcePart getLastResourcePart() {
return lastResourcePart;
}
@Override
public OrderByOption getOrderByOption() {
return orderByOption;
}
@ -219,7 +215,7 @@ public class UriInfoImpl implements UriInfo {
}
@Override
public SkipTokenOption getSkipTokenOption() {
public SkiptokenOption getSkipTokenOption() {
return skipTokenOption;
}
@ -228,13 +224,12 @@ public class UriInfoImpl implements UriInfo {
return topOption;
}
public UriInfoImpl setEntityTypeCast(EdmEntityType type) {
public UriInfoImpl setEntityTypeCast(final EdmEntityType type) {
entityTypeCast = type;
return this;
}
public UriInfoImpl setFormat(FormatOptionImpl formatOption) {
public UriInfoImpl setFormat(final FormatOptionImpl formatOption) {
this.formatOption = formatOption;
return this;
}
@ -244,33 +239,33 @@ public class UriInfoImpl implements UriInfo {
return this;
}
public UriInfoImpl setQueryOptions(List<QueryOptionImpl> list) {
public UriInfoImpl setQueryOptions(final List<QueryOptionImpl> list) {
for (QueryOptionImpl item : list) {
if (item instanceof SystemQueryOptionImpl) {
SystemQueryOptionImpl sysItem = (SystemQueryOptionImpl) item;
if (sysItem.getKind() == SystemQueryOptionEnum.EXPAND) {
if (sysItem.getKind() == SupportedQueryOptions.EXPAND) {
expandOption = (ExpandOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.FILTER) {
} else if (sysItem.getKind() == SupportedQueryOptions.FILTER) {
filterOption = (FilterOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.FORMAT) {
} else if (sysItem.getKind() == SupportedQueryOptions.FORMAT) {
formatOption = (FormatOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.ID) {
} else if (sysItem.getKind() == SupportedQueryOptions.ID) {
idOption = (IdOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.INLINECOUNT) {
inlineCountOption = (InlineCountImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.ORDERBY) {
} else if (sysItem.getKind() == SupportedQueryOptions.INLINECOUNT) {
inlineCountOption = (InlineCountOptionImpl) sysItem;
} else if (sysItem.getKind() == SupportedQueryOptions.ORDERBY) {
orderByOption = (OrderByImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.SEARCH) {
} else if (sysItem.getKind() == SupportedQueryOptions.SEARCH) {
searchOption = (SearchOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.SELECT) {
} else if (sysItem.getKind() == SupportedQueryOptions.SELECT) {
selectOption = (SelectOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.SKIP) {
} else if (sysItem.getKind() == SupportedQueryOptions.SKIP) {
skipOption = (SkipOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.SKIPTOKEN) {
skipTokenOption = (SkipTokenOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.TOP) {
} else if (sysItem.getKind() == SupportedQueryOptions.SKIPTOKEN) {
skipTokenOption = (SkiptokenOptionImpl) sysItem;
} else if (sysItem.getKind() == SupportedQueryOptions.TOP) {
topOption = (TopOptionImpl) sysItem;
}
} else if (item instanceof CustomQueryOptionImpl) {
@ -287,7 +282,5 @@ public class UriInfoImpl implements UriInfo {
public void clearPathInfo() {
pathParts.clear();
}
}

View File

@ -33,7 +33,7 @@ public class UriParameterImpl implements UriParameter {
return name;
}
public UriParameterImpl setName(String name) {
public UriParameterImpl setName(final String name) {
this.name = name;
return this;
}
@ -43,7 +43,7 @@ public class UriParameterImpl implements UriParameter {
return alias;
}
public UriParameterImpl setAlias(String alias) {
public UriParameterImpl setAlias(final String alias) {
this.alias = alias;
return this;
}
@ -53,7 +53,7 @@ public class UriParameterImpl implements UriParameter {
return text;
}
public UriParameterImpl setText(String text) {
public UriParameterImpl setText(final String text) {
this.text = text;
return this;
}
@ -64,7 +64,7 @@ public class UriParameterImpl implements UriParameter {
return expression;
}
public UriParameterImpl setExpression(Expression expression) {
public UriParameterImpl setExpression(final Expression expression) {
this.expression = expression;
return this;
}

View File

@ -23,16 +23,14 @@ public class UriParserException extends Exception {
/**
*
*/
private static final long serialVersionUID = -1813203179082217112L;
private static final long serialVersionUID = 1L;
public UriParserException(String message, Throwable cause) {
public UriParserException(final String message, final Throwable cause) {
super(message, cause);
}
public UriParserException(String message) {
public UriParserException(final String message) {
super(message, null);
}
}

View File

@ -24,16 +24,14 @@ public class UriParserSemanticException extends UriParserException {
/**
*
*/
private static final long serialVersionUID = -1813203179082217112L;
private static final long serialVersionUID = 1L;
public UriParserSemanticException(String message, Throwable cause) {
public UriParserSemanticException(final String message, final Throwable cause) {
super(message, cause);
}
public UriParserSemanticException(String message) {
public UriParserSemanticException(final String message) {
super(message, null);
}
}

View File

@ -23,13 +23,13 @@ public class UriParserSyntaxException extends UriParserException {
/**
*
*/
private static final long serialVersionUID = -975557346686301719L;
private static final long serialVersionUID = 1L;
public UriParserSyntaxException(String message, Throwable cause) {
public UriParserSyntaxException(final String message, final Throwable cause) {
super(message, cause);
}
public UriParserSyntaxException(String message) {
public UriParserSyntaxException(final String message) {
super(message, null);
}

View File

@ -38,7 +38,7 @@ public class UriResourceActionImpl extends UriResourceImplTyped implements UriRe
return action;
}
public UriResourceActionImpl setAction(EdmAction action) {
public UriResourceActionImpl setAction(final EdmAction action) {
this.action = action;
return this;
}
@ -48,17 +48,12 @@ public class UriResourceActionImpl extends UriResourceImplTyped implements UriRe
return actionImport;
}
public UriResourceActionImpl setActionImport(EdmActionImport actionImport) {
public UriResourceActionImpl setActionImport(final EdmActionImport actionImport) {
this.actionImport = actionImport;
this.setAction(actionImport.getAction());
setAction(actionImport.getAction());
return this;
}
@Override
public String toString() {
return action.getName() + super.toString();
}
@Override
public boolean isCollection() {
if (action != null) {
@ -72,4 +67,13 @@ public class UriResourceActionImpl extends UriResourceImplTyped implements UriRe
return action.getReturnType().getType();
}
@Override
public String toString() {
if (actionImport != null) {
return actionImport.getName();
} else if (action != null) {
return action.getName();
}
return "";
}
}

View File

@ -32,7 +32,7 @@ public class UriResourceAllImpl extends UriResourceImplTyped implements UriResou
private ExpressionImpl expression;
public UriResourceAllImpl() {
super(UriResourceKind.lamdaAll);
super(UriResourceKind.lambdaAll);
}
@Override
@ -50,7 +50,7 @@ public class UriResourceAllImpl extends UriResourceImplTyped implements UriResou
return lamdaVariable;
}
public UriResourceAllImpl setLamdaVariable(String lamdaVariable) {
public UriResourceAllImpl setLamdaVariable(final String lamdaVariable) {
this.lamdaVariable = lamdaVariable;
return this;
};
@ -60,8 +60,13 @@ public class UriResourceAllImpl extends UriResourceImplTyped implements UriResou
return expression;
}
public UriResourceAllImpl setExpression(ExpressionImpl expression) {
public UriResourceAllImpl setExpression(final ExpressionImpl expression) {
this.expression = expression;
return this;
};
@Override
public String toString() {
return "all";
}
}

View File

@ -32,7 +32,7 @@ public class UriResourceAnyImpl extends UriResourceImplTyped implements UriResou
private ExpressionImpl expression;
public UriResourceAnyImpl() {
super(UriResourceKind.lamdaAny);
super(UriResourceKind.lambdaAny);
}
@Override
@ -50,7 +50,7 @@ public class UriResourceAnyImpl extends UriResourceImplTyped implements UriResou
return lamdaVariable;
}
public UriResourceAnyImpl setLamdaVariable(String lamdaVariable) {
public UriResourceAnyImpl setLamdaVariable(final String lamdaVariable) {
this.lamdaVariable = lamdaVariable;
return this;
};
@ -60,8 +60,13 @@ public class UriResourceAnyImpl extends UriResourceImplTyped implements UriResou
return expression;
}
public UriResourceAnyImpl setExpression(ExpressionImpl expression) {
public UriResourceAnyImpl setExpression(final ExpressionImpl expression) {
this.expression = expression;
return this;
}
@Override
public String toString() {
return "any";
};
}

View File

@ -37,14 +37,14 @@ public class UriResourceComplexPropertyImpl extends UriResourceImplTyped impleme
return property;
}
public UriResourceComplexPropertyImpl setProperty(EdmProperty property) {
public UriResourceComplexPropertyImpl setProperty(final EdmProperty property) {
this.property = property;
return this;
}
@Override
public EdmComplexType getComplexType() {
return (EdmComplexType) this.getType();
return (EdmComplexType) getType();
}
@Override
@ -62,4 +62,9 @@ public class UriResourceComplexPropertyImpl extends UriResourceImplTyped impleme
return property.isCollection();
}
@Override
public String toString() {
return property.getName();
}
}

View File

@ -27,4 +27,9 @@ public class UriResourceCountImpl extends UriResourcePartImpl implements UriReso
super(UriResourceKind.count);
}
@Override
public String toString() {
return "$count";
}
}

View File

@ -37,16 +37,11 @@ public class UriResourceEntitySetImpl extends UriResourceImplKeyPred implements
return edmEntitySet;
}
public UriResourceEntitySetImpl setEntitSet(EdmEntitySet edmES) {
this.edmEntitySet = edmES;
public UriResourceEntitySetImpl setEntitSet(final EdmEntitySet edmES) {
edmEntitySet = edmES;
return this;
}
@Override
public String toString() {
return edmEntitySet.getName() + super.toString();
}
@Override
public EdmEntityType getEntityType() {
return edmEntitySet.getEntityType();
@ -54,11 +49,7 @@ public class UriResourceEntitySetImpl extends UriResourceImplKeyPred implements
@Override
public EdmType getType() {
/*if (singleTypeFilter != null) {
return singleTypeFilter;
} else if (collectionTypeFilter != null) {
return collectionTypeFilter;
}*/
return edmEntitySet.getEntityType();
}
@ -71,4 +62,9 @@ public class UriResourceEntitySetImpl extends UriResourceImplKeyPred implements
return false;
}
@Override
public String toString() {
return edmEntitySet.getName();
}
}

View File

@ -50,7 +50,7 @@ public class UriResourceFunctionImpl extends UriResourceImplKeyPred implements U
return retList;
}
public UriResourceFunctionImpl setParameters(List<UriParameterImpl> parameters) {
public UriResourceFunctionImpl setParameters(final List<UriParameterImpl> parameters) {
this.parameters = parameters;
return this;
}
@ -60,7 +60,7 @@ public class UriResourceFunctionImpl extends UriResourceImplKeyPred implements U
return function;
}
public UriResourceFunctionImpl setFunction(EdmFunction function) {
public UriResourceFunctionImpl setFunction(final EdmFunction function) {
this.function = function;
return this;
}
@ -70,8 +70,9 @@ public class UriResourceFunctionImpl extends UriResourceImplKeyPred implements U
return functionImport;
}
public UriResourceFunctionImpl setFunctionImport(EdmFunctionImport edmFI, List<UriParameterImpl> parameters) {
this.functionImport = edmFI;
public UriResourceFunctionImpl setFunctionImport(final EdmFunctionImport edmFI,
final List<UriParameterImpl> parameters) {
functionImport = edmFI;
this.parameters = parameters;
List<String> names = new ArrayList<String>();
@ -84,11 +85,6 @@ public class UriResourceFunctionImpl extends UriResourceImplKeyPred implements U
return this;
}
@Override
public String toString() {
return function.getName() + super.toString();
}
@Override
public EdmType getType() {
@ -104,7 +100,14 @@ public class UriResourceFunctionImpl extends UriResourceImplKeyPred implements U
return function.getReturnType().isCollection();
}
@Override
public String toString() {
if (functionImport != null) {
return functionImport.getName();
} else if (function != null) {
return function.getName();
}
return "";
}
}

View File

@ -31,7 +31,7 @@ public abstract class UriResourceImplKeyPred extends UriResourceImplTyped {
protected List<UriParameterImpl> keyPredicates = null;
protected EdmType singleTypeFilter = null;
public UriResourceImplKeyPred(UriResourceKind kind) {
public UriResourceImplKeyPred(final UriResourceKind kind) {
super(kind);
}
@ -58,18 +58,17 @@ public abstract class UriResourceImplKeyPred extends UriResourceImplTyped {
return retList;
}
public UriResourceImplKeyPred setKeyPredicates(List<UriParameterImpl> list) {
public UriResourceImplKeyPred setKeyPredicates(final List<UriParameterImpl> list) {
keyPredicates = list;
return this;
}
public void setSingleTypeFilter(EdmType singleTypeFilter) {
public void setSingleTypeFilter(final EdmType singleTypeFilter) {
this.singleTypeFilter = singleTypeFilter;
}
public void setCollectionTypeFilter(EdmType collectionTypeFilter) {
public void setCollectionTypeFilter(final EdmType collectionTypeFilter) {
this.collectionTypeFilter = collectionTypeFilter;
}
}

View File

@ -27,15 +27,15 @@ public abstract class UriResourceImplTyped extends UriResourcePartImpl implement
protected EdmType typeFilter = null;
public UriResourceImplTyped(UriResourceKind kind) {
public UriResourceImplTyped(final UriResourceKind kind) {
super(kind);
}
public EdmType getTypeFilter() {//TODO rename to TypeFilter
public EdmType getTypeFilter() {
return typeFilter;
}
public UriResourceImplTyped setTypeFilter(EdmStructuralType typeFilter) {
public UriResourceImplTyped setTypeFilter(final EdmStructuralType typeFilter) {
this.typeFilter = typeFilter;
return this;
}

View File

@ -31,21 +31,11 @@ public class UriResourceItImpl extends UriResourceImplKeyPred implements UriReso
private EdmType type;
private boolean isCollection;
public UriResourceItImpl() {
super(UriResourceKind.it);
}
@Override
public String toString() {
if (explicitIT) {
return "$it" + super.toString();
}
return super.toString();
}
public UriResourceItImpl setIsExplicitIT(boolean explicitIT) {
public UriResourceItImpl setIsExplicitIT(final boolean explicitIT) {
this.explicitIT = explicitIT;
return this;
}
@ -68,16 +58,19 @@ public class UriResourceItImpl extends UriResourceImplKeyPred implements UriReso
return isCollection;
}
public UriResourceItImpl setType(EdmType type) {
public UriResourceItImpl setType(final EdmType type) {
this.type = type;
return this;
}
public UriResourceItImpl setCollection(boolean isCollection) {
public UriResourceItImpl setCollection(final boolean isCollection) {
this.isCollection = isCollection;
return this;
}
@Override
public String toString() {
return "$it";
}
}

View File

@ -0,0 +1,67 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri;
import org.apache.olingo.odata4.commons.api.edm.EdmType;
import org.apache.olingo.odata4.producer.api.uri.UriResourceIt;
import org.apache.olingo.odata4.producer.api.uri.UriResourceKind;
import org.apache.olingo.odata4.producer.api.uri.UriResourceLambdaRef;
public class UriResourceLambdaRefImpl extends UriResourceImplTyped implements UriResourceLambdaRef {
private EdmType type;
private boolean isCollection;
private String variableText;
public UriResourceLambdaRefImpl() {
super(UriResourceKind.lambdaVariable);
}
@Override
public String getVariableText() {
return variableText;
}
public UriResourceLambdaRefImpl setVariableText(String variableText) {
this.variableText = variableText;
return this;
}
@Override
public EdmType getType() {
return type;
}
public UriResourceLambdaRefImpl setType(EdmType type) {
this.type = type;
return this;
}
@Override
public boolean isCollection() {
return isCollection;
}
public UriResourceLambdaRefImpl isCollection(boolean isCollection) {
this.isCollection = isCollection;
return this;
}
}

View File

@ -31,29 +31,19 @@ public class UriResourceNavigationPropertyImpl extends UriResourceImplKeyPred im
super(UriResourceKind.navigationProperty);
}
@Override
public String toString() {
return navigationProperty.getName() + super.toString();
}
@Override
public EdmNavigationProperty getNavigationProperty() {
return navigationProperty;
}
public UriResourceNavigationPropertyImpl addNavigationProperty(EdmNavigationProperty property) {
this.navigationProperty = property;
public UriResourceNavigationPropertyImpl setNavigationProperty(final EdmNavigationProperty property) {
navigationProperty = property;
return this;
}
@Override
public EdmType getType() {
/*if (singleTypeFilter != null) {
return singleTypeFilter;
} else if (collectionTypeFilter != null) {
return collectionTypeFilter;
}*/
return navigationProperty.getType();
}
@ -63,10 +53,11 @@ public class UriResourceNavigationPropertyImpl extends UriResourceImplKeyPred im
return false;
}
return navigationProperty.isCollection();
}
@Override
public String toString() {
return navigationProperty.getName();
}
}

View File

@ -24,10 +24,10 @@ import org.apache.olingo.odata4.producer.api.uri.UriResourcePart;
/**
* Covers Functionimports and BoundFunction in URI
*/
public class UriResourcePartImpl implements UriResourcePart {
public abstract class UriResourcePartImpl implements UriResourcePart {
protected UriResourceKind kind;
public UriResourcePartImpl(UriResourceKind kind) {
public UriResourcePartImpl(final UriResourceKind kind) {
this.kind = kind;
}

View File

@ -26,7 +26,7 @@ import org.apache.olingo.odata4.producer.api.uri.UriResourceSimpleProperty;
public class UriResourcePropertyImpl extends UriResourceImplTyped implements UriResourceSimpleProperty {
protected EdmProperty property;
public UriResourcePropertyImpl(UriResourceKind kind) {
public UriResourcePropertyImpl(final UriResourceKind kind) {
super(kind);
}
@ -35,7 +35,7 @@ public class UriResourcePropertyImpl extends UriResourceImplTyped implements Uri
return property;
}
public UriResourcePropertyImpl setProperty(EdmProperty property) {
public UriResourcePropertyImpl setProperty(final EdmProperty property) {
this.property = property;
return this;
}
@ -48,7 +48,11 @@ public class UriResourcePropertyImpl extends UriResourceImplTyped implements Uri
@Override
public boolean isCollection() {
return property.isCollection();
}
@Override
public String toString() {
return property.getName();
}
}

View File

@ -18,9 +18,9 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri;
import org.apache.olingo.odata4.producer.api.uri.UriResourceKind;
import org.apache.olingo.odata4.producer.api.uri.UriResourceRef;
public class UriResourceRefImpl extends UriResourcePartImpl implements UriResourceRef {
public UriResourceRefImpl() {
@ -28,7 +28,9 @@ public class UriResourceRefImpl extends UriResourcePartImpl implements UriResour
}
@Override
public String toString() {
return "$ref";
}
}

View File

@ -27,6 +27,9 @@ public class UriResourceRootImpl extends UriResourcePartImpl implements UriReso
super(UriResourceKind.root);
}
@Override
public String toString() {
return "$root";
}
}

View File

@ -18,7 +18,6 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri;
import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
import org.apache.olingo.odata4.commons.api.edm.EdmType;
import org.apache.olingo.odata4.producer.api.uri.UriResourceKind;
@ -32,14 +31,12 @@ public class UriResourceSimplePropertyImpl extends UriResourceImplTyped implemen
super(UriResourceKind.simpleProperty);
}
@Override
public EdmProperty getProperty() {
return property;
}
public UriResourceSimplePropertyImpl setProperty( EdmProperty property) {
public UriResourceSimplePropertyImpl setProperty(final EdmProperty property) {
this.property = property;
return this;
}
@ -54,6 +51,9 @@ public class UriResourceSimplePropertyImpl extends UriResourceImplTyped implemen
return property.isCollection();
}
@Override
public String toString() {
return property.getName();
}
}

View File

@ -32,13 +32,12 @@ public class UriResourceSingletonImpl extends UriResourceImplTyped implements Ur
super(UriResourceKind.singleton);
}
@Override
public EdmSingleton getSingleton() {
return singleton;
}
public UriResourceSingletonImpl setSingleton(EdmSingleton singleton) {
public UriResourceSingletonImpl setSingleton(final EdmSingleton singleton) {
this.singleton = singleton;
return this;
@ -49,11 +48,6 @@ public class UriResourceSingletonImpl extends UriResourceImplTyped implements Ur
return (EdmEntityType) typeFilter;
}
@Override
public String toString() {
return singleton.getName() + super.toString();
}
@Override
public EdmType getType() {
return singleton.getEntityType();
@ -69,13 +63,9 @@ public class UriResourceSingletonImpl extends UriResourceImplTyped implements Ur
return false;
}
@Override
public String toString() {
return singleton.toString();
}
}

View File

@ -18,10 +18,9 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri;
import org.apache.olingo.odata4.producer.api.uri.UriResourceKind;
import org.apache.olingo.odata4.producer.api.uri.UriResourceValue;
public class UriResourceValueImpl extends UriResourcePartImpl implements UriResourceValue {
public UriResourceValueImpl() {
@ -29,7 +28,9 @@ public class UriResourceValueImpl extends UriResourcePartImpl implements UriReso
}
@Override
public String toString() {
return "$value";
}
}

View File

@ -22,7 +22,7 @@ import org.apache.olingo.odata4.producer.api.uri.queryoption.AliasQueryOption;
import org.apache.olingo.odata4.producer.core.uri.queryoption.expression.ExpressionImpl;
public class AliasQueryOptionImpl extends QueryOptionImpl implements AliasQueryOption {
// TODO change value of alias to a interface which need to be defined
private ExpressionImpl aliasValue;
@Override
@ -30,13 +30,9 @@ public class AliasQueryOptionImpl extends QueryOptionImpl implements AliasQueryO
return aliasValue;
}
public AliasQueryOptionImpl setAliasValue(ExpressionImpl aliasValue) {
public AliasQueryOptionImpl setAliasValue(final ExpressionImpl aliasValue) {
this.aliasValue = aliasValue;
return this;
}
}

View File

@ -22,5 +22,4 @@ import org.apache.olingo.odata4.producer.api.uri.queryoption.CustomQueryOption;
public class CustomQueryOptionImpl extends QueryOptionImpl implements CustomQueryOption {
}

View File

@ -23,11 +23,10 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.odata4.commons.api.edm.Edm;
import org.apache.olingo.odata4.producer.api.uri.UriResourceProperty;
import org.apache.olingo.odata4.producer.api.uri.UriInfoResource;
import org.apache.olingo.odata4.producer.api.uri.queryoption.ExceptionVisitExpand;
import org.apache.olingo.odata4.producer.api.uri.queryoption.ExpandItem;
import org.apache.olingo.odata4.producer.api.uri.queryoption.ExpandOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.ExpandVisitor;
import org.apache.olingo.odata4.producer.api.uri.queryoption.FilterOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.InlineCountOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.LevelExpandOption;
@ -35,18 +34,11 @@ import org.apache.olingo.odata4.producer.api.uri.queryoption.OrderByOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SearchOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SelectOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SkipOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SupportedQueryOptions;
import org.apache.olingo.odata4.producer.api.uri.queryoption.TopOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.VisitableExpand;
public class ExpandItemImpl implements ExpandItem, VisitableExpand {
private Edm edm;
private ExpandSegment lastExpandSegment = null;
private List<ExpandSegment> segments = new ArrayList<ExpandSegment>();
private boolean isStar;
public class ExpandItemImpl implements ExpandItem {
private LevelExpandOption levelExpandOption;
private FilterOption filterOption;
private SearchOption searchOption;
@ -57,49 +49,44 @@ public class ExpandItemImpl implements ExpandItem, VisitableExpand {
private SelectOption selectOption;
private ExpandOption expandOption;
public ExpandItemImpl setEdm(Edm edm) {
this.edm = edm;
private UriInfoResource resourcePath;
private boolean isStar;
private boolean isRef;
public ExpandItemImpl setEdm(final Edm edm) {
return this;
}
public ExpandItemImpl setStar(boolean isStar) {
this.isStar = isStar;
return this;
}
public ExpandSegment getLastSegement() {
return lastExpandSegment;
}
public ExpandItemImpl setExpandQueryOption(QueryOptionImpl item) {
public ExpandItemImpl setExpandQueryOption(final QueryOptionImpl item) {
if (item instanceof SystemQueryOptionImpl) {
SystemQueryOptionImpl sysItem = (SystemQueryOptionImpl) item;
if (sysItem.getKind() == SystemQueryOptionEnum.EXPAND) {
if (sysItem.getKind() == SupportedQueryOptions.EXPAND) {
expandOption = (ExpandOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.FILTER) {
} else if (sysItem.getKind() == SupportedQueryOptions.FILTER) {
filterOption = (FilterOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.INLINECOUNT) {
inlineCountOption = (InlineCountImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.ORDERBY) {
} else if (sysItem.getKind() == SupportedQueryOptions.INLINECOUNT) {
inlineCountOption = (InlineCountOptionImpl) sysItem;
} else if (sysItem.getKind() == SupportedQueryOptions.ORDERBY) {
orderByOption = (OrderByImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.SEARCH) {
} else if (sysItem.getKind() == SupportedQueryOptions.SEARCH) {
searchOption = (SearchOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.SELECT) {
} else if (sysItem.getKind() == SupportedQueryOptions.SELECT) {
selectOption = (SelectOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.SKIP) {
} else if (sysItem.getKind() == SupportedQueryOptions.SKIP) {
skipOption = (SkipOptionImpl) sysItem;
} else if (sysItem.getKind() == SystemQueryOptionEnum.TOP) {
} else if (sysItem.getKind() == SupportedQueryOptions.TOP) {
topOption = (TopOptionImpl) sysItem;
} else if (sysItem.getKind() == SupportedQueryOptions.LEVEL) {
levelExpandOption = (LevelExpandOption) sysItem;
}
}
return this;
}
public ExpandItemImpl setExpandQueryOptions(List<QueryOptionImpl> list) {
public ExpandItemImpl setExpandQueryOptions(final List<QueryOptionImpl> list) {
for (QueryOptionImpl item : list) {
setExpandQueryOption(item);
@ -107,40 +94,8 @@ public class ExpandItemImpl implements ExpandItem, VisitableExpand {
return this;
}
public ExpandItemImpl addSegment(ExpandSegment segment) {
lastExpandSegment = segment;
segments.add(segment);
return this;
}
@Override
public <T> T accept(ExpandVisitor<T> visitor) throws ExceptionVisitExpand {
List<T> parameters = new ArrayList<T>();
for (ExpandSegment segment : segments) {
parameters.add(segment.accept(visitor));
}
// TODO implement visitor pattern for options
return null; //visitor.visitExpandItem(parameters, isStar, isRef, finalType);
}
@Override
public boolean isStar() {
return isStar;
}
@Override
public List<UriResourceProperty> getPropertyChainList() {
return null;
}
@Override
public LevelExpandOption getLevel() {
@ -188,6 +143,35 @@ public class ExpandItemImpl implements ExpandItem, VisitableExpand {
return expandOption;
}
public ExpandItemImpl setResourcePath(final UriInfoResource resourcePath) {
this.resourcePath = resourcePath;
return this;
}
@Override
public UriInfoResource getPath() {
return resourcePath;
}
@Override
public boolean isStar() {
return isStar;
}
public ExpandItemImpl setIsStar(final boolean isStar) {
this.isStar = isStar;
return this;
}
@Override
public boolean isRef() {
return isRef;
}
public ExpandItemImpl setIsRef(final boolean isRef) {
this.isRef = isRef;
return this;
}
}

View File

@ -24,22 +24,21 @@ import java.util.List;
import org.apache.olingo.odata4.producer.api.uri.queryoption.ExceptionVisitExpand;
import org.apache.olingo.odata4.producer.api.uri.queryoption.ExpandItem;
import org.apache.olingo.odata4.producer.api.uri.queryoption.ExpandOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.ExpandVisitor;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
import org.apache.olingo.odata4.producer.api.uri.queryoption.VisitableExpand;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SupportedQueryOptions;
public class ExpandOptionImpl extends SystemQueryOptionImpl implements ExpandOption, VisitableExpand {
public class ExpandOptionImpl extends SystemQueryOptionImpl implements ExpandOption {
List<ExpandItemImpl> expandItems = new ArrayList<ExpandItemImpl>();
public ExpandOptionImpl() {
setKind(SystemQueryOptionEnum.EXPAND);
setKind(SupportedQueryOptions.EXPAND);
}
public void addExpandItem(ExpandItemImpl expandItem) {
public void addExpandItem(final ExpandItemImpl expandItem) {
expandItems.add(expandItem);
}
@Override
public List<ExpandItem> getExpandItems() {
List<ExpandItem> retList = new ArrayList<ExpandItem>();
for (ExpandItemImpl item : expandItems) {
@ -48,14 +47,5 @@ public class ExpandOptionImpl extends SystemQueryOptionImpl implements ExpandOpt
return retList;
}
@Override
public <T> T accept(ExpandVisitor<T> visitor) throws ExceptionVisitExpand {
List<T> parameters = new ArrayList<T>();
for (ExpandItemImpl expandItem : expandItems) {
parameters.add(expandItem.accept(visitor));
}
return visitor.visitExpand(parameters);
}
}

View File

@ -18,9 +18,8 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri.queryoption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.FilterOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SupportedQueryOptions;
import org.apache.olingo.odata4.producer.core.uri.queryoption.expression.ExpressionImpl;
public class FilterOptionImpl extends SystemQueryOptionImpl implements FilterOption {
@ -28,10 +27,10 @@ public class FilterOptionImpl extends SystemQueryOptionImpl implements FilterOpt
private ExpressionImpl expression;
public FilterOptionImpl() {
setKind(SystemQueryOptionEnum.FILTER);
setKind(SupportedQueryOptions.FILTER);
}
public FilterOptionImpl setExpression(ExpressionImpl expression) {
public FilterOptionImpl setExpression(final ExpressionImpl expression) {
this.expression = expression;
return this;
}
@ -41,6 +40,4 @@ public class FilterOptionImpl extends SystemQueryOptionImpl implements FilterOpt
return expression;
}
}

View File

@ -19,17 +19,16 @@
package org.apache.olingo.odata4.producer.core.uri.queryoption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.FormatOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SupportedQueryOptions;
public class FormatOptionImpl extends SystemQueryOptionImpl implements FormatOption {
private String value;
public FormatOptionImpl() {
setKind(SystemQueryOptionEnum.FORMAT);
setKind(SupportedQueryOptions.FORMAT);
}
public FormatOptionImpl setValue(String value) {
public FormatOptionImpl setValue(final String value) {
this.value = value;
return this;
}
@ -39,5 +38,4 @@ public class FormatOptionImpl extends SystemQueryOptionImpl implements FormatOpt
return value;
}
}

View File

@ -18,29 +18,21 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri.queryoption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.IdOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SupportedQueryOptions;
public class IdOptionImpl extends SystemQueryOptionImpl implements IdOption {
private String value;
public IdOptionImpl() {
setKind(SystemQueryOptionEnum.ID);
setKind(SupportedQueryOptions.ID);
}
public IdOptionImpl setValue(String value) {
public IdOptionImpl setValue(final String value) {
this.value = value;
return this;
}
//TODO remove
public String getValue() {
return value;
}
@Override
public String getIdValue() {
return value;

View File

@ -19,30 +19,28 @@
package org.apache.olingo.odata4.producer.core.uri.queryoption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.InlineCountOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SupportedQueryOptions;
public class InlineCountOptionImpl extends SystemQueryOptionImpl implements InlineCountOption {
public class InlineCountImpl extends SystemQueryOptionImpl implements InlineCountOption {
private boolean count;
private String count;
public InlineCountImpl() {
setKind(SystemQueryOptionEnum.INLINECOUNT);
public InlineCountOptionImpl() {
setKind(SupportedQueryOptions.INLINECOUNT);
}
public String getCount() {
@Override
public boolean getvalue() {
return count;
}
public InlineCountImpl setCount(String count) {
public InlineCountOptionImpl setValue(boolean count) {
this.count = count;
return this;
}
@Override
public boolean getInlineCountValue() {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -19,36 +19,40 @@
******************************************************************************/
package org.apache.olingo.odata4.producer.core.uri.queryoption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
import org.apache.olingo.odata4.producer.api.uri.queryoption.LevelExpandOption;
import org.apache.olingo.odata4.producer.api.uri.queryoption.SupportedQueryOptions;
public class LevelOptionImpl extends SystemQueryOptionImpl implements LevelOption{
public class LevelExpandOptionImpl extends SystemQueryOptionImpl implements LevelExpandOption {
private boolean isMax;
private String value;
private int value;
public LevelOptionImpl() {
setKind(SystemQueryOptionEnum.LEVEL);
public LevelExpandOptionImpl() {
setKind(SupportedQueryOptions.LEVEL);
}
public LevelOptionImpl setValue(String value) {
public LevelExpandOptionImpl setValue(final int value) {
this.value = value;
return this;
}
public String getValue() {
public int getValue() {
return value;
}
@Override
public boolean isMax() {
return isMax;
}
public LevelOptionImpl setMax() {
public LevelExpandOptionImpl setMax() {
isMax = true;
return this;
}
@Override
public int getLevel() {
return value;
}
}

Some files were not shown because too many files have changed in this diff Show More