本文整理汇总了Java中org.apache.olingo.server.api.uri.queryoption.expression.Member类的典型用法代码示例。如果您正苦于以下问题:Java Member类的具体用法?Java Member怎么用?Java Member使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Member类属于org.apache.olingo.server.api.uri.queryoption.expression包,在下文中一共展示了Member类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toSort
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
/**
* Converts {@link OrderByItem} to {@link Sort} needed for
* {@link Pagination}.
*
* @param orderByItem
* order by item
* @return sort instance, or null in case order by item wasn't specific type
*/
protected Sort toSort(OrderByItem orderByItem) {
Expression expression = orderByItem.getExpression();
if (expression instanceof Member) {
UriInfoResource resourcePath = ((Member) expression).getResourcePath();
UriResource uriResource = resourcePath.getUriResourceParts().get(0);
if (uriResource instanceof UriResourcePrimitiveProperty) {
EdmProperty edmProperty = ((UriResourcePrimitiveProperty) uriResource)
.getProperty();
String property = edmProperty.getName();
if (edmProperty instanceof ElasticEdmProperty) {
ElasticEdmProperty entityTypeProperty = (ElasticEdmProperty) edmProperty;
property = addKeywordIfNeeded(entityTypeProperty.getEField(),
entityTypeProperty.getAnnotations());
}
return new Sort(property,
orderByItem.isDescending() ? Sort.Direction.DESC : Sort.Direction.ASC);
}
}
return null;
}
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:29,代码来源:RequestCreator.java
示例2: accept
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
public void accept(Expression expr) {
if (expr instanceof Alias) {
visit((Alias) expr);
} else if (expr instanceof Binary) {
visit((Binary) expr);
} else if (expr instanceof Enumeration) {
visit((Enumeration) expr);
} else if (expr instanceof LambdaRef) {
visit((LambdaRef) expr);
} else if (expr instanceof Literal) {
visit((Literal) expr);
} else if (expr instanceof Member) {
visit((Member) expr);
} else if (expr instanceof Method) {
visit((Method) expr);
} else if (expr instanceof TypeLiteral) {
visit((TypeLiteral) expr);
} else if (expr instanceof Unary) {
visit((Unary) expr);
}
}
开发者ID:kenweezy,项目名称:teiid,代码行数:22,代码来源:ODataExpressionVisitor.java
示例3: visitMember
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
@Override
public String visitMember(final Member member) throws ExpressionVisitException, ODataApplicationException {
String ret = "";
for (UriResource item : member.getResourcePath().getUriResourceParts()) {
String tmp = "";
if (item instanceof UriResourceLambdaAll) {
UriResourceLambdaAll all = (UriResourceLambdaAll) item;
tmp = visitLambdaExpression("ALL", all.getLambdaVariable(), all.getExpression());
} else if (item instanceof UriResourceLambdaAny) {
UriResourceLambdaAny any = (UriResourceLambdaAny) item;
tmp = visitLambdaExpression("ANY", any.getLambdaVariable(), any.getExpression());
} else if (item instanceof UriResourcePartTyped) {
UriResourcePartTyped typed = (UriResourcePartTyped) item;
tmp = typed.toString(true);
}
if (ret.length() > 0) {
ret += "/";
}
ret += tmp;
}
return "<" + ret + ">";
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:26,代码来源:FilterTreeToText.java
示例4: isType
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
public FilterValidator isType(final FullQualifiedName fullName) {
EdmType actualType = null;
if (curExpression instanceof Member) {
actualType = ((Member) curExpression).getType();
} else if (curExpression instanceof TypeLiteral) {
actualType = ((TypeLiteral) curExpression).getType();
} else if (curExpression instanceof Literal) {
actualType = ((Literal) curExpression).getType();
} else if (curExpression instanceof Enumeration) {
actualType = ((Enumeration) curExpression).getType();
} else if (curExpression instanceof Unary) {
actualType = ((UnaryImpl) curExpression).getType();
} else if (curExpression instanceof Binary) {
actualType = ((BinaryImpl) curExpression).getType();
} else if (curExpression instanceof Method) {
actualType = ((MethodImpl) curExpression).getType();
}
assertNotNull("Current expression not typed", actualType);
assertEquals(fullName, actualType.getFullQualifiedName());
return this;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:24,代码来源:FilterValidator.java
示例5: visitMember
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
@Override
public Object visitMember(final Member member) throws ExpressionVisitException, ODataApplicationException {
// To keeps things simple, this tutorial allows only primitive properties.
// We have faith that the java type of Edm.Int32 is Integer
final List<UriResource> uriResourceParts = member.getResourcePath().getUriResourceParts();
// Make sure that the resource path of the property contains only a single segment and a primitive property
// has been addressed. We can be sure, that the property exists because the UriParser checks if the
// property has been defined in service metadata document.
if(uriResourceParts.size() == 1 && uriResourceParts.get(0) instanceof UriResourcePrimitiveProperty) {
UriResourcePrimitiveProperty uriResourceProperty = (UriResourcePrimitiveProperty) uriResourceParts.get(0);
return currentEntity.getProperty(uriResourceProperty.getProperty().getName()).getValue();
} else {
// The OData specification allows in addition complex properties and navigation properties
// with a target cardinality 0..1 or 1.
// This means any combination can occur e.g. Supplier/Address/City
// -> Navigation properties Supplier
// -> Complex Property Address
// -> Primitive Property City
// For such cases the resource path returns a list of UriResourceParts
throw new ODataApplicationException("Only primitive properties are implemented in filter expressions",
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ENGLISH);
}
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:27,代码来源:FilterExpressionVisitor.java
示例6: visitMember
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
public Object visitMember(final Member member) throws ExpressionVisitException, ODataApplicationException {
// To keeps things simple, this tutorial allows only primitive properties.
// We have faith that the java type of Edm.Int32 is Integer
final List<UriResource> uriResourceParts = member.getResourcePath().getUriResourceParts();
// Make sure that the resource path of the property contains only a single segment and a primitive property
// has been addressed. We can be sure, that the property exists because the UriParser checks if the
// property has been defined in service metadata document.
if(uriResourceParts.size() == 1 && uriResourceParts.get(0) instanceof UriResourcePrimitiveProperty) {
UriResourcePrimitiveProperty uriResourceProperty = (UriResourcePrimitiveProperty) uriResourceParts.get(0);
return currentEntity.getProperty(uriResourceProperty.getProperty().getName()).getValue();
} else {
// The OData specification allows in addition complex properties and navigation properties
// with a target cardinality 0..1 or 1.
// This means any combination can occur e.g. Supplier/Address/City
// -> Navigation properties Supplier
// -> Complex Property Address
// -> Primitive Property City
// For such cases the resource path returns a list of UriResourceParts
throw new ODataApplicationException("Only primitive properties are implemented in filter expressions",
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ENGLISH);
}
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:26,代码来源:FilterExpressionVisitor.java
示例7: visitMember
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
@Override
public VisitorOperand visitMember(Member member) throws ExpressionVisitException, ODataApplicationException {
final List<UriResource> uriResourceParts = member.getResourcePath().getUriResourceParts();
int size = uriResourceParts.size();
if (uriResourceParts.get(0) instanceof UriResourceProperty) {
EdmProperty currentEdmProperty = ((UriResourceProperty) uriResourceParts.get(0)).getProperty();
Property currentProperty = entity.getProperty(currentEdmProperty.getName());
return new TypedOperand(currentProperty.getValue(), currentEdmProperty.getType(), currentEdmProperty);
} else if (uriResourceParts.get(size - 1) instanceof UriResourceLambdaAll) {
return throwNotImplemented();
} else if (uriResourceParts.get(size - 1) instanceof UriResourceLambdaAny) {
return throwNotImplemented();
} else {
return throwNotImplemented();
}
}
开发者ID:wso2,项目名称:carbon-data,代码行数:17,代码来源:ExpressionVisitorImpl.java
示例8: visitMember
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
@Override
public SQLExpression visitMember(Member member) throws ExpressionVisitException, ODataApplicationException {
final List<UriResource> uriResourceParts = member.getResourcePath().getUriResourceParts();
if(uriResourceParts.size() == 1 && uriResourceParts.get(0) instanceof UriResourcePrimitiveProperty) {
UriResourcePrimitiveProperty uriResourceProperty = (UriResourcePrimitiveProperty) uriResourceParts.get(0);
String name = uriResourceProperty.getProperty().getName();
Table table = new Table().setName(alias);
return new Column(alias != null ? table : null , name);
} else {
throw new ODataApplicationException("Only primitive properties are implemented in filter expressions",
HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);
}
}
开发者ID:jbaliuka,项目名称:sql-analytic,代码行数:19,代码来源:FilterExpressionVisitor.java
示例9: toFieldName
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
/**
* Converts to Elasticsearch field name.
*
* @param member
* to convert from
* @return Elasticsearch field name
*/
public static String toFieldName(Member member) {
return member.getResourcePath()
.getUriResourceParts()
.stream()
.map(uriResource -> ((UriResourceProperty) uriResource).getProperty().getName())
.collect(Collectors.joining("."));
}
开发者ID:pukkaone,项目名称:odata-spring-boot-starter,代码行数:15,代码来源:MemberMapper.java
示例10: configureSorting
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
private static void configureSorting(UriInfo uriInfo, SearchRequestBuilder searchRequest) {
if (uriInfo.getOrderByOption() == null) {
return;
}
for (OrderByItem orderByItem : uriInfo.getOrderByOption().getOrders()) {
searchRequest.addSort(
MemberMapper.toFieldName((Member) orderByItem.getExpression()),
orderByItem.isDescending() ? SortOrder.DESC : SortOrder.ASC);
}
}
开发者ID:pukkaone,项目名称:odata-spring-boot-starter,代码行数:12,代码来源:EntityRepository.java
示例11: visitMember
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
@Override
public ExpressionMember visitMember(Member member)
throws ExpressionVisitException, ODataApplicationException {
MemberHandler handler = new MemberHandler(member, this);
UriResource collectionResource = handler.getCollectionResource();
if (collectionResource != null) {
collectionResourceCache.put(handler.getPath(), collectionResource);
}
return handler.handle(Collections.unmodifiableMap(collectionResourceCache));
}
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:11,代码来源:ElasticSearchExpressionVisitor.java
示例12: MemberHandler
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
/**
* Initializes member handler using raw olingo expression member.
*
* @param member
* raw olingo expression member
* @param visitor
* visitor instance
*/
public MemberHandler(Member member, ExpressionVisitor<?> visitor) {
this.visitor = visitor;
UriInfoImpl resource = (UriInfoImpl) member.getResourcePath();
resourceParts = resource.getUriResourceParts();
firstPart = resourceParts.get(0);
lastPart = resourceParts.get(resourceParts.size() - 1);
String parentPath = resource.getFragment();
pathToMember = collectPathToMember(parentPath);
}
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:18,代码来源:MemberHandler.java
示例13: setPath
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
private void setPath(Expression expression) {
if (expression instanceof Member) {
setPath((Member) expression);
} else if (expression instanceof Binary) {
Binary binaryExpression = (Binary) expression;
setPath(binaryExpression.getLeftOperand());
setPath(binaryExpression.getRightOperand());
} else if (expression instanceof Method) {
Method method = (Method) expression;
method.getParameters().forEach(this::setPath);
}
}
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:13,代码来源:MemberHandler.java
示例14: goPath
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
public ResourceValidator goPath() {
isMember();
Member member = (Member) curExpression;
return new ResourceValidator()
.setEdm(edm)
.setUriInfoPath(member.getResourcePath())
.setUpValidator(this);
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:10,代码来源:FilterValidator.java
示例15: isMemberStartType
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
public FilterValidator isMemberStartType(final FullQualifiedName fullName) {
isMember();
Member member = (Member) curExpression;
EdmType actualType = member.getStartTypeFilter();
assertEquals(fullName, actualType.getFullQualifiedName());
return this;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:8,代码来源:FilterValidator.java
示例16: getType
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
protected static EdmType getType(final Expression expression) throws UriParserException {
EdmType type;
if (expression instanceof Literal) {
type = ((Literal) expression).getType();
} else if (expression instanceof TypeLiteral) {
type = ((TypeLiteral) expression).getType();
} else if (expression instanceof Enumeration) {
type = ((Enumeration) expression).getType();
} else if (expression instanceof Member) {
type = ((Member) expression).getType();
} else if (expression instanceof Unary) {
type = ((UnaryImpl) expression).getType();
} else if (expression instanceof Binary) {
type = ((BinaryImpl) expression).getType();
} else if (expression instanceof Method) {
type = ((MethodImpl) expression).getType();
} else if (expression instanceof Alias) {
final AliasQueryOption alias = ((AliasImpl) expression).getAlias();
type = alias == null || alias.getValue() == null ? null : getType(alias.getValue());
} else if (expression instanceof LambdaRef) {
throw new UriParserSemanticException("Type determination not implemented.",
UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED, expression.toString());
} else {
throw new UriParserSemanticException("Unknown expression type.",
UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED, expression.toString());
}
if (type != null && type.getKind() == EdmTypeKind.DEFINITION) {
type = ((EdmTypeDefinition) type).getUnderlyingType();
}
return type;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:32,代码来源:ExpressionParser.java
示例17: visitMember
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
@Override
public Object visitMember(Member member)
throws ExpressionVisitException, ODataApplicationException {
return MemberMapper.toFieldName(member);
}
开发者ID:pukkaone,项目名称:odata-spring-boot-starter,代码行数:7,代码来源:ElasticsearchExpressionVisitor.java
示例18: visit
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
@Override
public void visit(Member expr) {
ResourcePropertyCollector visitor = new ResourcePropertyCollector();
visitor.visit(expr.getResourcePath());
UriResource resource = visitor.getResource();
if (resource.getKind() == UriResourceKind.primitiveProperty) {
this.stack.add(new ElementSymbol(((UriResourceProperty) resource)
.getProperty().getName(), context
.getEdmEntityTableGroup()));
} else if (resource.getKind() == UriResourceKind.navigationProperty) {
EdmNavigationProperty navigation = ((UriResourceNavigation) resource).getProperty();
EdmEntityType type = navigation.getType();
if (!visitor.isCount()) {
this.exceptions.add(new TeiidException(ODataPlugin.Event.TEIID16028, ODataPlugin.Util.gs(ODataPlugin.Event.TEIID16028)));
}
GroupSymbol navGroup = new GroupSymbol(context.getNextAliasGroup(), type.getNamespace() + "." + type.getName());//$NON-NLS-1$
Query query = new Query();
query.setSelect(new Select(Arrays.asList(new AggregateSymbol(AggregateSymbol.Type.COUNT.name(), false, null))));
query.setFrom(new From(Arrays.asList(new UnaryFromClause(navGroup))));
Criteria criteria = null;
for (ForeignKey fk : context.getEdmEntityTable().getForeignKeys()) {
if (fk.getName().equals(navigation.getName())) {
List<String> lhsColumns = ODataSQLBuilder.getColumnNames(fk.getColumns());
List<String> rhsColumns = fk.getReferenceColumns();
for (int i = 0; i < lhsColumns.size(); i++) {
if (criteria == null) {
criteria = new CompareCriteria(new ElementSymbol(lhsColumns.get(i),context.getEdmEntityTableGroup()),
CompareCriteria.EQ, new ElementSymbol(rhsColumns.get(i), navGroup));
} else {
Criteria subcriteria = new CompareCriteria(new ElementSymbol(lhsColumns.get(i), context.getEdmEntityTableGroup()),
CompareCriteria.EQ, new ElementSymbol(rhsColumns.get(i), navGroup));
criteria = new CompoundCriteria(CompoundCriteria.AND, criteria, subcriteria);
}
}
break;
}
}
query.setCriteria(criteria);
this.stack.add(new ScalarSubquery(query));
}
}
开发者ID:kenweezy,项目名称:teiid,代码行数:45,代码来源:ODataExpressionToSQLVisitor.java
示例19: visit
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
void visit(@SuppressWarnings("unused") Member expr) {
}
开发者ID:kenweezy,项目名称:teiid,代码行数:3,代码来源:ODataExpressionVisitor.java
示例20: isMember
import org.apache.olingo.server.api.uri.queryoption.expression.Member; //导入依赖的package包/类
public FilterValidator isMember() {
assertTrue("Current expression not a member", curExpression instanceof Member);
return this;
}
开发者ID:apache,项目名称:olingo-odata4,代码行数:5,代码来源:FilterValidator.java
注:本文中的org.apache.olingo.server.api.uri.queryoption.expression.Member类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论