@Override public boolean isCollection() { return action.getReturnType() != null && action.getReturnType().isCollection(); }
@Override public EdmType getType() { return action.getReturnType() == null ? null : action.getReturnType().getType(); }
@Override public EdmType getType() { return action.getReturnType() == null ? null : action.getReturnType().getType(); }
@Override public boolean isCollection() { return action.getReturnType() != null && action.getReturnType().isCollection(); }
@Override public boolean hasReturnType() { return getAction().getReturnType() != null; }
@Override public boolean hasReturnType() { return getAction().getReturnType() != null; }
@Override public EdmReturnType getReturnType() { assert (hasReturnType()); return getAction().getReturnType(); }
@Override public EdmReturnType getReturnType() { assert (hasReturnType()); return getAction().getReturnType(); }
@Override public boolean isCollection() { assert (hasReturnType()); return getAction().getReturnType().isCollection(); }
@Override public boolean isCollection() { assert (hasReturnType()); return getAction().getReturnType().isCollection(); }
@Override @SuppressWarnings("unchecked") public <RES extends ClientInvokeResult> ODataInvokeRequest<RES> getBoundActionInvokeRequest( final URI bindingParameterURI, final FullQualifiedName actionName, final FullQualifiedName bindingParameterTypeName, final Boolean isBindingParameterCollection, final Map<String, ClientValue> parameters) { final EdmAction action = edmClient.getCachedEdm().getBoundAction( actionName, bindingParameterTypeName, isBindingParameterCollection); if (action == null) { throw new IllegalArgumentException("Could not find Action for name " + actionName); } return (ODataInvokeRequest<RES>) getInvokeRequest(HttpMethod.POST, edmClient.newURIBuilder(bindingParameterURI.toASCIIString()). appendOperationCallSegment(action.getFullQualifiedName().toString()).build(), getResultReference(action.getReturnType()), parameters); } }
@Override @SuppressWarnings("unchecked") public <RES extends ClientInvokeResult> ODataInvokeRequest<RES> getBoundActionInvokeRequest( final URI bindingParameterURI, final FullQualifiedName actionName, final FullQualifiedName bindingParameterTypeName, final Boolean isBindingParameterCollection, final Map<String, ClientValue> parameters) { final EdmAction action = edmClient.getCachedEdm().getBoundAction( actionName, bindingParameterTypeName, isBindingParameterCollection); if (action == null) { throw new IllegalArgumentException("Could not find Action for name " + actionName); } return (ODataInvokeRequest<RES>) getInvokeRequest(HttpMethod.POST, edmClient.newURIBuilder(bindingParameterURI.toASCIIString()). appendOperationCallSegment(action.getFullQualifiedName().toString()).build(), getResultReference(action.getReturnType()), parameters); } }
private EdmTypeKind determineReturnEdmTypeKind(final UriResourcePartTyped operation) { if (operation instanceof UriResourceFunction) return ((UriResourceFunction) operation).getFunction().getReturnType().getType().getKind(); else return ((UriResourceAction) operation).getAction().getReturnType().getType().getKind(); }
if (resource.getAction().getReturnType() != null) { returnType = resource.getAction().getReturnType().getType(); final Object result = jpaAction.getMethod().invoke(instance, parameter.toArray()); r = convertResult(result, returnType, jpaAction);
@Override @SuppressWarnings("unchecked") public <RES extends ClientInvokeResult> ODataInvokeRequest<RES> getActionImportInvokeRequest( final String actionImportName, final Map<String, ClientValue> parameters) { EdmActionImport eai = null; for (EdmSchema schema : edmClient.getCachedEdm().getSchemas()) { final EdmEntityContainer container = schema.getEntityContainer(); if (container != null) { eai = container.getActionImport(actionImportName); } } if (eai == null) { throw new IllegalArgumentException("Could not find ActionImport for name " + actionImportName); } return (ODataInvokeRequest<RES>) getInvokeRequest(HttpMethod.POST, edmClient.newURIBuilder().appendOperationCallSegment(actionImportName).build(), getResultReference(eai.getUnboundAction().getReturnType()), parameters); }
@Override @SuppressWarnings("unchecked") public <RES extends ClientInvokeResult> ODataInvokeRequest<RES> getActionImportInvokeRequest( final String actionImportName, final Map<String, ClientValue> parameters) { EdmActionImport eai = null; for (EdmSchema schema : edmClient.getCachedEdm().getSchemas()) { final EdmEntityContainer container = schema.getEntityContainer(); if (container != null) { eai = container.getActionImport(actionImportName); } } if (eai == null) { throw new IllegalArgumentException("Could not find ActionImport for name " + actionImportName); } return (ODataInvokeRequest<RES>) getInvokeRequest(HttpMethod.POST, edmClient.newURIBuilder().appendOperationCallSegment(actionImportName).build(), getResultReference(eai.getUnboundAction().getReturnType()), parameters); }
private UriType getUriTypeForAction(final UriResource lastPathSegment) throws UriValidationException { final EdmReturnType rt = ((UriResourceAction) lastPathSegment).getAction().getReturnType(); if (rt == null) { return UriType.none; } UriType uriType; switch (rt.getType().getKind()) { case ENTITY: uriType = rt.isCollection() ? UriType.entitySet : UriType.entity; break; case PRIMITIVE: case ENUM: case DEFINITION: uriType = rt.isCollection() ? UriType.propertyPrimitiveCollection : UriType.propertyPrimitive; break; case COMPLEX: uriType = rt.isCollection() ? UriType.propertyComplexCollection : UriType.propertyComplex; break; default: throw new UriValidationException("Unsupported action return type: " + rt.getType().getKind(), UriValidationException.MessageKeys.UNSUPPORTED_ACTION_RETURN_TYPE, rt.getType().getKind().toString()); } return uriType; }
private UriType getUriTypeForAction(final UriResource lastPathSegment) throws UriValidationException { final EdmReturnType rt = ((UriResourceAction) lastPathSegment).getAction().getReturnType(); if (rt == null) { return UriType.none; } UriType uriType; switch (rt.getType().getKind()) { case ENTITY: uriType = rt.isCollection() ? UriType.entitySet : UriType.entity; break; case PRIMITIVE: case ENUM: case DEFINITION: uriType = rt.isCollection() ? UriType.propertyPrimitiveCollection : UriType.propertyPrimitive; break; case COMPLEX: uriType = rt.isCollection() ? UriType.propertyComplexCollection : UriType.propertyComplex; break; default: throw new UriValidationException("Unsupported action return type: " + rt.getType().getKind(), UriValidationException.MessageKeys.UNSUPPORTED_ACTION_RETURN_TYPE, rt.getType().getKind().toString()); } return uriType; }
final EdmReturnType returnType = action.getReturnType(); if (returnType == null) { handler.selectProcessor(ActionVoidProcessor.class)
final EdmReturnType returnType = action.getReturnType(); if (returnType == null) { handler.selectProcessor(ActionVoidProcessor.class)