param = new ServerBaseParamBinder(); } else if (nextAnnotation instanceof Elements) { param = new ElementsParameter(); } else if (nextAnnotation instanceof Since) { param = new SinceParameter();
@Override @SuppressWarnings({ "rawtypes", "unchecked" }) public Object translateQueryParametersIntoServerArgument(RequestDetails theRequest, BaseMethodBinding<?> theMethodBinding) throws InternalErrorException, InvalidRequestException { Set<String> value = getElementsValueOrNull(theRequest); if (value == null || value.isEmpty()) { return null; } if (myInnerCollectionType == null) { return StringUtils.join(value, ','); } try { Collection retVal = myInnerCollectionType.newInstance(); retVal.addAll(value); return retVal; } catch (InstantiationException e) { throw new InternalErrorException("Failed to instantiate " + myInnerCollectionType, e); } catch (IllegalAccessException e) { throw new InternalErrorException("Failed to instantiate " + myInnerCollectionType, e); } }
Set<String> elements = ElementsParameter.getElementsValueOrNull(theRequestDetails); if (elements != null && summaryMode != null && !summaryMode.equals(Collections.singleton(SummaryEnum.FALSE))) { throw new InvalidRequestException("Cannot combine the " + Constants.PARAM_SUMMARY + " and " + Constants.PARAM_ELEMENTS + " parameters");
param = new ServerBaseParamBinder(); } else if (nextAnnotation instanceof Elements) { param = new ElementsParameter(); } else if (nextAnnotation instanceof Since) { param = new SinceParameter();
@Override @SuppressWarnings({"rawtypes", "unchecked"}) public Object translateQueryParametersIntoServerArgument(RequestDetails theRequest, BaseMethodBinding<?> theMethodBinding) throws InternalErrorException, InvalidRequestException { Set<String> value = getElementsValueOrNull(theRequest, false); if (value == null || value.isEmpty()) { return null; } if (myInnerCollectionType == null) { return StringUtils.join(value, ','); } try { Collection retVal = myInnerCollectionType.newInstance(); retVal.addAll(value); return retVal; } catch (InstantiationException e) { throw new InternalErrorException("Failed to instantiate " + myInnerCollectionType, e); } catch (IllegalAccessException e) { throw new InternalErrorException("Failed to instantiate " + myInnerCollectionType, e); } }
Set<String> elements = ElementsParameter.getElementsValueOrNull(theRequestDetails, false); if (elements != null) { b.append('&'); Set<String> elementsExclude = ElementsParameter.getElementsValueOrNull(theRequestDetails, true); if (elementsExclude != null) { b.append('&');
Set<String> elements = ElementsParameter.getElementsValueOrNull(theRequestDetails, false); if (elements != null && summaryMode != null && !summaryMode.equals(Collections.singleton(SummaryEnum.FALSE))) { throw new InvalidRequestException("Cannot combine the " + Constants.PARAM_SUMMARY + " and " + Constants.PARAM_ELEMENTS + " parameters"); Set<String> elementsExclude = ElementsParameter.getElementsValueOrNull(theRequestDetails, true); if (elementsExclude != null) { parser.setDontEncodeElements(elementsExclude);