@Override public UriInfoResource getResourcePath() { return parentItem.getResourcePath(); }
public ExpandSQLBuilder(ExpandItem ei) { if (ei.getResourcePath() != null) { visit(ei.getResourcePath()); } }
@Override public List<UriResource> getUriResourceParts() { return item.getResourcePath() != null ? item.getResourcePath().getUriResourceParts() : new ArrayList<>(1); }
@Override public List<UriResource> getUriResourceParts() { return item.getResourcePath() != null ? item.getResourcePath().getUriResourceParts() : new ArrayList<>(1); }
public static Set<String> getExpandedPropertyNames(final List<ExpandItem> expandItems) throws SerializerException { Set<String> expanded = new HashSet<String>(); for (final ExpandItem item : expandItems) { final List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); final UriResource resource = resourceParts.get(0); if (resource instanceof UriResourceNavigation) { expanded.add(((UriResourceNavigation) resource).getProperty().getName()); } } return expanded; }
public static Set<String> getExpandedPropertyNames(final List<ExpandItem> expandItems) throws SerializerException { Set<String> expanded = new HashSet<String>(); for (final ExpandItem item : expandItems) { final List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); final UriResource resource = resourceParts.get(0); if (resource instanceof UriResourceNavigation) { expanded.add(((UriResourceNavigation) resource).getProperty().getName()); } } return expanded; }
private boolean hasExpand(String name, ExpandOption expandOption) { if (expandOption == null) { return false; } for (ExpandItem ei:expandOption.getExpandItems()) { String expand = ((UriResourceEntitySetImpl)ei.getResourcePath().getUriResourceParts().get(0)).getEntitySet().getName(); if (expand.equalsIgnoreCase(name)) { return true; } } return false; }
public static ExpandItem getExpandItem(final List<ExpandItem> expandItems, final String propertyName) { for (final ExpandItem item : expandItems) { if (item.isStar()) { continue; } final List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); UriResource resource = null; if (resourceParts.get(resourceParts.size() - 1) instanceof UriResourceRef || resourceParts.get(resourceParts.size() - 1) instanceof UriResourceCount) { resource = resourceParts.get(resourceParts.size() - 2); } else { resource = resourceParts.get(resourceParts.size() - 1); } if ((resource instanceof UriResourceNavigation && propertyName.equals(((UriResourceNavigation) resource).getProperty().getName())) || resource instanceof UriResourceProperty && propertyName.equals(((UriResourceProperty) resource).getProperty().getName())) { return item; } } return null; }
public static ExpandItem getExpandItem(final List<ExpandItem> expandItems, final String propertyName) { for (final ExpandItem item : expandItems) { if (item.isStar()) { continue; } final List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); UriResource resource = null; if (resourceParts.get(resourceParts.size() - 1) instanceof UriResourceRef || resourceParts.get(resourceParts.size() - 1) instanceof UriResourceCount) { resource = resourceParts.get(resourceParts.size() - 2); } else { resource = resourceParts.get(resourceParts.size() - 1); } if ((resource instanceof UriResourceNavigation && propertyName.equals(((UriResourceNavigation) resource).getProperty().getName())) || resource instanceof UriResourceProperty && propertyName.equals(((UriResourceProperty) resource).getProperty().getName())) { return item; } } return null; }
public static Set<List<String>> getExpandedItemsPath(ExpandOption expand) { Set<List<String>> expandPaths = new HashSet<List<String>>(); if (expand != null) { List<ExpandItem> expandItems = expand.getExpandItems(); for (ExpandItem item : expandItems) { if (item.isStar()) { continue; } List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); if (resourceParts.get(0) instanceof UriResourceComplexProperty) { List<String> path = new ArrayList<String>(); for (UriResource resource : resourceParts) { if (resource instanceof UriResourceNavigation) { path.add(((UriResourceNavigation) resource).getProperty().getName()); } else if (resource instanceof UriResourceProperty) { path.add(((UriResourceProperty) resource).getProperty().getName()); } } expandPaths.add(path); } } } return expandPaths; }
continue; final List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); UriResource resource = null; if (resourceParts.size() == 1) {
continue; final List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); UriResource resource = null; if (resourceParts.size() == 1) {
public static Set<List<String>> getExpandedItemsPath(ExpandOption expand) { Set<List<String>> expandPaths = new HashSet<List<String>>(); if (expand != null) { List<ExpandItem> expandItems = expand.getExpandItems(); for (ExpandItem item : expandItems) { if (item.isStar()) { continue; } List<UriResource> resourceParts = item.getResourcePath().getUriResourceParts(); if (resourceParts.get(0) instanceof UriResourceComplexProperty) { List<String> path = new ArrayList<String>(); for (UriResource resource : resourceParts) { if (resource instanceof UriResourceNavigation) { path.add(((UriResourceNavigation) resource).getProperty().getName()); } else if (resource instanceof UriResourceProperty) { path.add(((UriResourceProperty) resource).getProperty().getName()); } } expandPaths.add(path); } } } return expandPaths; }
final List<UriResource> resourceParts = expandItem.getResourcePath().getUriResourceParts(); if (resourceParts.size() > 1) { if (result.length() > 0) {
private void appendExpandItemJson(final JsonGenerator gen, final ExpandItem item) throws IOException { gen.writeStartObject(); if (item.isStar()) { gen.writeBooleanField("star", item.isStar()); } else if (item.getResourcePath() != null && !item.getResourcePath().getUriResourceParts().isEmpty()) { gen.writeFieldName("expandPath"); appendURIResourceParts(gen, item.getResourcePath().getUriResourceParts()); } if (item.isRef()) { gen.writeBooleanField("isRef", item.isRef()); } if (item.getLevelsOption() != null) { gen.writeFieldName("levels"); if (item.getLevelsOption().isMax()) { gen.writeString("max"); } else { gen.writeNumber(item.getLevelsOption().getValue()); } } appendCommonJsonObjects(gen, item.getCountOption(), item.getSkipOption(), item.getTopOption(), item.getFilterOption(), item.getOrderByOption(), item.getSelectOption(), item.getExpandOption(), item.getSearchOption(), item.getApplyOption()); gen.writeEndObject(); }
final List<UriResource> resourceParts = expandItem.getResourcePath().getUriResourceParts(); if (resourceParts.size() > 1) { if (result.length() > 0) {
private void appendExpandItemJson(final JsonGenerator gen, final ExpandItem item) throws IOException { gen.writeStartObject(); if (item.isStar()) { gen.writeBooleanField("star", item.isStar()); } else if (item.getResourcePath() != null && !item.getResourcePath().getUriResourceParts().isEmpty()) { gen.writeFieldName("expandPath"); appendURIResourceParts(gen, item.getResourcePath().getUriResourceParts()); } if (item.isRef()) { gen.writeBooleanField("isRef", item.isRef()); } if (item.getLevelsOption() != null) { gen.writeFieldName("levels"); if (item.getLevelsOption().isMax()) { gen.writeString("max"); } else { gen.writeNumber(item.getLevelsOption().getValue()); } } appendCommonJsonObjects(gen, item.getCountOption(), item.getSkipOption(), item.getTopOption(), item.getFilterOption(), item.getOrderByOption(), item.getSelectOption(), item.getExpandOption(), item.getSearchOption(), item.getApplyOption()); gen.writeEndObject(); }
final List<UriResource> targetResourceList = item.getResourcePath().getUriResourceParts(); associationName = new StringBuilder(); associationName.append(associationNamePrefix);
List<ExpandItem> expandItems = expandOption.getExpandItems(); for (int i = 0; i < expandItems.size(); i++) { UriResource uriResource = expandItems.get(i).getResourcePath().getUriResourceParts().get(0); EdmEntityType entity = ((UriResourceNavigation) uriResource).getProperty().getType(); String navName=((UriResourceNavigation) uriResource).getProperty().getName();
UriResource uriResource = expandItem.getResourcePath().getUriResourceParts().get(0); if (uriResource instanceof UriResourceNavigation) { edmNavigationProperty = ((UriResourceNavigation) uriResource).getProperty();