public UriInfoImpl setQueryOption(final QueryOption option) { if (option instanceof SystemQueryOption) { setSystemQueryOption((SystemQueryOption) option); } else if (option instanceof AliasQueryOption) { addAlias((AliasQueryOption) option); } else if (option instanceof CustomQueryOption) { addCustomQueryOption((CustomQueryOption) option); } return this; }
public UriInfoImpl setQueryOption(final QueryOption option) { if (option instanceof SystemQueryOption) { setSystemQueryOption((SystemQueryOption) option); } else if (option instanceof AliasQueryOption) { addAlias((AliasQueryOption) option); } else if (option instanceof CustomQueryOption) { addCustomQueryOption((CustomQueryOption) option); } return this; }
public static UriInfoImpl constructDeepReadForDraftRoot(EdmEntitySet entitySet,Map<String,List<String>> draftTree,UriInfo requestUriInfo) throws ODataApplicationException { UriInfoImpl uriInfoForRead=null; if(requestUriInfo!=null) { uriInfoForRead=(UriInfoImpl)requestUriInfo; }else { UriResourceEntitySet entitySetForRead = new UriResourceEntitySetImpl(entitySet); uriInfoForRead = new UriInfoImpl().addResourcePart(entitySetForRead); } ExpandOptionImpl eo=constructDraftTreeExpand(EdmHelper.getEdmEntitySet(uriInfoForRead, null).getEntityType(),(ExpandOptionImpl) uriInfoForRead.getExpandOption(),draftTree); if(eo!=null && eo.getExpandItems()!=null&&!eo.getExpandItems().isEmpty()) { uriInfoForRead.setSystemQueryOption(eo); } return uriInfoForRead; }
private static ExpandOptionImpl constructDraftTreeExpand(EdmEntityType rootEntityType,ExpandOptionImpl eO,Map<String,List<String>> draftTree) { if(eO==null) { eO=new ExpandOptionImpl(); } if(rootEntityType.getNavigationPropertyNames()!=null && !rootEntityType.getNavigationPropertyNames().isEmpty()) { for(String navName:rootEntityType.getNavigationPropertyNames()) { EdmNavigationProperty expandNp=rootEntityType.getNavigationProperty(navName); if(draftTree.get(rootEntityType.getName()).contains(expandNp.getType().getName())) { UriResourceNavigationPropertyImpl adminNaVPropImpl=new UriResourceNavigationPropertyImpl(expandNp); UriInfoImpl uriInfoForExpand = new UriInfoImpl().addResourcePart(adminNaVPropImpl); //Recursively set compositions ExpandOption innerExpandoption=constructDraftTreeExpand(expandNp.getType(),(ExpandOptionImpl) uriInfoForExpand.getExpandOption(),draftTree); if(innerExpandoption!=null) { uriInfoForExpand.setSystemQueryOption(innerExpandoption); ExpandItem eI = new ExpandItemImpl().setResourcePath(uriInfoForExpand).setSystemQueryOption(innerExpandoption); eO.addExpandItem(eI); } } } return eO; } return eO; }