diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml
index 207b14ac276..a5d135cec62 100644
--- a/hapi-fhir-base/pom.xml
+++ b/hapi-fhir-base/pom.xml
@@ -92,34 +92,6 @@
true
-
- org.springframework
- spring-beans
- true
-
-
- commons-logging
- commons-logging
-
-
-
-
- org.springframework
- spring-web
- true
-
-
- commons-logging
- commons-logging
-
-
-
-
- org.springframework
- spring-test
- test
-
-
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java
index 26a65eeb896..8049e75ff41 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java
@@ -1,5 +1,7 @@
package ca.uhn.fhir.rest.param;
+import static org.apache.commons.lang3.StringUtils.isBlank;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
/*
@@ -27,14 +29,22 @@ import org.hl7.fhir.instance.model.api.IIdType;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.rest.annotation.*;
+import ca.uhn.fhir.rest.api.Constants;
+import ca.uhn.fhir.rest.api.QualifiedParamList;
+import ca.uhn.fhir.util.ReflectionUtil;
import ca.uhn.fhir.util.UrlUtil;
public class ParameterUtil {
private static final Set> BINDABLE_INTEGER_TYPES;
+ private static final String LABEL = "label=\"";
+ private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ParameterUtil.class);
+
+ private static final String SCHEME = "scheme=\"";
static {
HashSet> intTypes = new HashSet>();
@@ -44,9 +54,15 @@ public class ParameterUtil {
}
- // public static Integer findSinceParameterIndex(Method theMethod) {
- // return findParamIndex(theMethod, Since.class);
- // }
+ @SuppressWarnings("unchecked")
+ public static T convertIdToType(IIdType value, Class theIdParamType) {
+ if (value != null && !theIdParamType.isAssignableFrom(value.getClass())) {
+ IIdType newValue = ReflectionUtil.newInstance(theIdParamType);
+ newValue.setValue(value.getValue());
+ value = newValue;
+ }
+ return (T) value;
+ }
/**
* Escapes a string according to the rules for parameter escaping specified in the FHIR Specification Escaping
@@ -61,14 +77,14 @@ public class ParameterUtil {
for (int i = 0; i < theValue.length(); i++) {
char next = theValue.charAt(i);
switch (next) {
- case '$':
- case ',':
- case '|':
- case '\\':
- b.append('\\');
- break;
- default:
- break;
+ case '$':
+ case ',':
+ case '|':
+ case '\\':
+ b.append('\\');
+ break;
+ default:
+ break;
}
b.append(next);
}
@@ -116,6 +132,10 @@ public class ParameterUtil {
return index;
}
+ // public static Integer findSinceParameterIndex(Method theMethod) {
+ // return findParamIndex(theMethod, Since.class);
+ // }
+
public static Integer findParamAnnotationIndex(Method theMethod, Class> toFind) {
int paramIndex = 0;
for (Annotation[] annotations : theMethod.getParameterAnnotations()) {
@@ -170,6 +190,134 @@ public class ParameterUtil {
return -1;
}
+ public static String parseETagValue(String value) {
+ String eTagVersion;
+ value = value.trim();
+ if (value.length() > 1) {
+ if (value.charAt(value.length() - 1) == '"') {
+ if (value.charAt(0) == '"') {
+ eTagVersion = value.substring(1, value.length() - 1);
+ } else if (value.length() > 3 && value.charAt(0) == 'W' && value.charAt(1) == '/'
+ && value.charAt(2) == '"') {
+ eTagVersion = value.substring(3, value.length() - 1);
+ } else {
+ eTagVersion = value;
+ }
+ } else {
+ eTagVersion = value;
+ }
+ } else {
+ eTagVersion = value;
+ }
+ return eTagVersion;
+ }
+
+ @Deprecated
+ public static void parseTagValue(TagList tagList, String nextTagComplete) {
+ StringBuilder next = new StringBuilder(nextTagComplete);
+ parseTagValue(tagList, nextTagComplete, next);
+ }
+
+ @Deprecated
+ private static void parseTagValue(TagList theTagList, String theCompleteHeaderValue, StringBuilder theBuffer) {
+ int firstSemicolon = theBuffer.indexOf(";");
+ int deleteTo;
+ if (firstSemicolon == -1) {
+ firstSemicolon = theBuffer.indexOf(",");
+ if (firstSemicolon == -1) {
+ firstSemicolon = theBuffer.length();
+ deleteTo = theBuffer.length();
+ } else {
+ deleteTo = firstSemicolon;
+ }
+ } else {
+ deleteTo = firstSemicolon + 1;
+ }
+
+ String term = theBuffer.substring(0, firstSemicolon);
+ String scheme = null;
+ String label = null;
+ if (isBlank(term)) {
+ return;
+ }
+
+ theBuffer.delete(0, deleteTo);
+ while (theBuffer.length() > 0 && theBuffer.charAt(0) == ' ') {
+ theBuffer.deleteCharAt(0);
+ }
+
+ while (theBuffer.length() > 0) {
+ boolean foundSomething = false;
+ if (theBuffer.length() > SCHEME.length() && theBuffer.substring(0, SCHEME.length()).equals(SCHEME)) {
+ int closeIdx = theBuffer.indexOf("\"", SCHEME.length());
+ scheme = theBuffer.substring(SCHEME.length(), closeIdx);
+ theBuffer.delete(0, closeIdx + 1);
+ foundSomething = true;
+ }
+ if (theBuffer.length() > LABEL.length() && theBuffer.substring(0, LABEL.length()).equals(LABEL)) {
+ int closeIdx = theBuffer.indexOf("\"", LABEL.length());
+ label = theBuffer.substring(LABEL.length(), closeIdx);
+ theBuffer.delete(0, closeIdx + 1);
+ foundSomething = true;
+ }
+ // TODO: support enc2231-string as described in
+ // http://tools.ietf.org/html/draft-johnston-http-category-header-02
+ // TODO: support multiple tags in one header as described in
+ // http://hl7.org/implement/standards/fhir/http.html#tags
+
+ while (theBuffer.length() > 0 && (theBuffer.charAt(0) == ' ' || theBuffer.charAt(0) == ';')) {
+ theBuffer.deleteCharAt(0);
+ }
+
+ if (!foundSomething) {
+ break;
+ }
+ }
+
+ if (theBuffer.length() > 0 && theBuffer.charAt(0) == ',') {
+ theBuffer.deleteCharAt(0);
+ while (theBuffer.length() > 0 && theBuffer.charAt(0) == ' ') {
+ theBuffer.deleteCharAt(0);
+ }
+ theTagList.add(new Tag(scheme, term, label));
+ parseTagValue(theTagList, theCompleteHeaderValue, theBuffer);
+ } else {
+ theTagList.add(new Tag(scheme, term, label));
+ }
+
+ if (theBuffer.length() > 0) {
+ ourLog.warn("Ignoring extra text at the end of " + Constants.HEADER_CATEGORY + " tag '"
+ + theBuffer.toString() + "' - Complete tag value was: " + theCompleteHeaderValue);
+ }
+
+ }
+
+ public static IQueryParameterOr> singleton(final IQueryParameterType theParam, final String theParamName) {
+ return new IQueryParameterOr() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public List getValuesAsQueryTokens() {
+ return Collections.singletonList(theParam);
+ }
+
+ @Override
+ public void setValuesAsQueryTokens(FhirContext theContext, String theParamName,
+ QualifiedParamList theParameters) {
+ if (theParameters.isEmpty()) {
+ return;
+ }
+ if (theParameters.size() > 1) {
+ throw new IllegalArgumentException(
+ "Type " + theParam.getClass().getCanonicalName() + " does not support multiple values");
+ }
+ theParam.setValueAsQueryToken(theContext, theParamName, theParameters.getQualifier(),
+ theParameters.get(0));
+ }
+ };
+ }
+
static List splitParameterString(String theInput, boolean theUnescapeComponents) {
return splitParameterString(theInput, ',', theUnescapeComponents);
}
@@ -245,13 +393,13 @@ public class ParameterUtil {
b.append(next);
} else {
switch (theValue.charAt(i + 1)) {
- case '$':
- case ',':
- case '|':
- case '\\':
- continue;
- default:
- b.append(next);
+ case '$':
+ case ',':
+ case '|':
+ case '\\':
+ continue;
+ default:
+ b.append(next);
}
}
} else {
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseAddOrDeleteTagsMethodBinding.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseAddOrDeleteTagsMethodBinding.java
index 43a9ef94fd5..ebd1a713e6c 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseAddOrDeleteTagsMethodBinding.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseAddOrDeleteTagsMethodBinding.java
@@ -17,7 +17,10 @@ import ca.uhn.fhir.rest.annotation.TagListParam;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.client.impl.BaseHttpClientInvocation;
-import ca.uhn.fhir.rest.server.exceptions.*;
+import ca.uhn.fhir.rest.param.ParameterUtil;
+import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
+import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
+import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
abstract class BaseAddOrDeleteTagsMethodBinding extends BaseMethodBinding {
@@ -38,9 +41,9 @@ abstract class BaseAddOrDeleteTagsMethodBinding extends BaseMethodBinding
myResourceName = theContext.getResourceDefinition(myType).getName();
- myIdParamIndex = MethodUtil.findIdParameterIndex(theMethod, getContext());
- myVersionIdParamIndex = MethodUtil.findVersionIdParameterIndex(theMethod);
- myTagListParamIndex = MethodUtil.findTagListParameterIndex(theMethod);
+ myIdParamIndex = ParameterUtil.findIdParameterIndex(theMethod, getContext());
+ myVersionIdParamIndex = ParameterUtil.findVersionIdParameterIndex(theMethod);
+ myTagListParamIndex = ParameterUtil.findTagListParameterIndex(theMethod);
if (myIdParamIndex == null) {
throw new ConfigurationException("Method '" + theMethod.getName() + "' does not have an @" + IdParam.class.getSimpleName() + " parameter.");
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseJavaPrimitiveBinder.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseJavaPrimitiveBinder.java
index 4ae5e0e0d5d..80e516b450e 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseJavaPrimitiveBinder.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseJavaPrimitiveBinder.java
@@ -28,6 +28,7 @@ import java.util.List;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.IQueryParameterOr;
import ca.uhn.fhir.rest.api.QualifiedParamList;
+import ca.uhn.fhir.rest.param.ParameterUtil;
import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
@@ -49,7 +50,7 @@ abstract class BaseJavaPrimitiveBinderimplements IParamBinder {
if (isBlank(retVal)) {
return Collections.emptyList();
}
- List> retValList = Collections.singletonList(MethodUtil.singleton(new StringParam(retVal), null));
+ List> retValList = Collections.singletonList(ParameterUtil.singleton(new StringParam(retVal), null));
return (List>) retValList;
}
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseOutcomeReturningMethodBindingWithResourceIdButNoResourceBody.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseOutcomeReturningMethodBindingWithResourceIdButNoResourceBody.java
index cb140f83d4d..baeae0d8b1a 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseOutcomeReturningMethodBindingWithResourceIdButNoResourceBody.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/BaseOutcomeReturningMethodBindingWithResourceIdButNoResourceBody.java
@@ -24,9 +24,14 @@ import java.lang.reflect.Method;
import org.hl7.fhir.instance.model.api.IBaseResource;
-import ca.uhn.fhir.context.*;
+import ca.uhn.fhir.context.ConfigurationException;
+import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.context.RuntimeResourceDefinition;
//TODO Use of a deprecated method should be resolved
-import ca.uhn.fhir.rest.annotation.*;
+import ca.uhn.fhir.rest.annotation.Delete;
+import ca.uhn.fhir.rest.annotation.IdParam;
+import ca.uhn.fhir.rest.annotation.VersionIdParam;
+import ca.uhn.fhir.rest.param.ParameterUtil;
public abstract class BaseOutcomeReturningMethodBindingWithResourceIdButNoResourceBody extends BaseOutcomeReturningMethodBinding {
@@ -45,12 +50,12 @@ public abstract class BaseOutcomeReturningMethodBindingWithResourceIdButNoResour
"Can not determine resource type for method '" + theMethod.getName() + "' on type " + theMethod.getDeclaringClass().getCanonicalName() + " - Did you forget to include the resourceType() value on the @" + Delete.class.getSimpleName() + " method annotation?");
}
- myIdParameterIndex = MethodUtil.findIdParameterIndex(theMethod, getContext());
+ myIdParameterIndex = ParameterUtil.findIdParameterIndex(theMethod, getContext());
if (myIdParameterIndex == null) {
throw new ConfigurationException("Method '" + theMethod.getName() + "' on type '" + theMethod.getDeclaringClass().getCanonicalName() + "' has no parameter annotated with the @" + IdParam.class.getSimpleName() + " annotation");
}
- Integer versionIdParameterIndex = MethodUtil.findVersionIdParameterIndex(theMethod);
+ Integer versionIdParameterIndex = ParameterUtil.findVersionIdParameterIndex(theMethod);
if (versionIdParameterIndex != null) {
//TODO Use of a deprecated method should be resolved
throw new ConfigurationException("Method '" + theMethod.getName() + "' on type '" + theMethod.getDeclaringClass().getCanonicalName() + "' has a parameter annotated with the @" + VersionIdParam.class.getSimpleName() + " annotation but delete methods may not have this annotation");
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/GetTagsMethodBinding.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/GetTagsMethodBinding.java
index 15b1ebd6453..6d31fa09dcd 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/GetTagsMethodBinding.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/GetTagsMethodBinding.java
@@ -19,6 +19,7 @@ import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.client.impl.BaseHttpClientInvocation;
+import ca.uhn.fhir.rest.param.ParameterUtil;
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
@@ -38,8 +39,8 @@ public class GetTagsMethodBinding extends BaseMethodBinding {
myResourceName = theContext.getResourceDefinition(myType).getName();
}
- myIdParamIndex = MethodUtil.findIdParameterIndex(theMethod, getContext());
- myVersionIdParamIndex = MethodUtil.findVersionIdParameterIndex(theMethod);
+ myIdParamIndex = ParameterUtil.findIdParameterIndex(theMethod, getContext());
+ myVersionIdParamIndex = ParameterUtil.findVersionIdParameterIndex(theMethod);
if (myIdParamIndex != null && myType.equals(IResource.class)) {
throw new ConfigurationException("Method '" + theMethod.getName() + "' does not specify a resource type, but has an @" + IdParam.class.getSimpleName()
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/HistoryMethodBinding.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/HistoryMethodBinding.java
index 08e5d2b5315..0886db3a5cf 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/HistoryMethodBinding.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/HistoryMethodBinding.java
@@ -37,6 +37,7 @@ import ca.uhn.fhir.rest.annotation.History;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.client.impl.BaseHttpClientInvocation;
+import ca.uhn.fhir.rest.param.ParameterUtil;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
public class HistoryMethodBinding extends BaseResourceReturningMethodBinding {
@@ -48,7 +49,7 @@ public class HistoryMethodBinding extends BaseResourceReturningMethodBinding {
public HistoryMethodBinding(Method theMethod, FhirContext theContext, Object theProvider) {
super(toReturnType(theMethod, theProvider), theMethod, theContext, theProvider);
- myIdParamIndex = MethodUtil.findIdParameterIndex(theMethod, getContext());
+ myIdParamIndex = ParameterUtil.findIdParameterIndex(theMethod, getContext());
History historyAnnotation = theMethod.getAnnotation(History.class);
Class extends IBaseResource> type = historyAnnotation.type();
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/MethodUtil.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/MethodUtil.java
index 5678a7e5586..4d4f996852f 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/MethodUtil.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/MethodUtil.java
@@ -1,6 +1,5 @@
package ca.uhn.fhir.rest.client.method;
-import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import java.io.*;
@@ -49,12 +48,10 @@ import ca.uhn.fhir.util.*;
@SuppressWarnings("deprecation")
public class MethodUtil {
- private static final String LABEL = "label=\"";
-
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(MethodUtil.class);
private static final Set ourServletRequestTypes = new HashSet();
private static final Set ourServletResponseTypes = new HashSet();
- private static final String SCHEME = "scheme=\"";
+
static {
ourServletRequestTypes.add("javax.servlet.ServletRequest");
ourServletResponseTypes.add("javax.servlet.ServletResponse");
@@ -80,16 +77,6 @@ public class MethodUtil {
}
}
- @SuppressWarnings("unchecked")
- public static T convertIdToType(IIdType value, Class theIdParamType) {
- if (value != null && !theIdParamType.isAssignableFrom(value.getClass())) {
- IIdType newValue = ReflectionUtil.newInstance(theIdParamType);
- newValue.setValue(value.getValue());
- value = newValue;
- }
- return (T) value;
- }
-
public static HttpGetClientInvocation createConformanceInvocation(FhirContext theContext) {
return new HttpGetClientInvocation(theContext, "metadata");
}
@@ -98,7 +85,8 @@ public class MethodUtil {
return createCreateInvocation(theResource, null, null, theContext);
}
- public static HttpPostClientInvocation createCreateInvocation(IBaseResource theResource, String theResourceBody, String theId, FhirContext theContext) {
+ public static HttpPostClientInvocation createCreateInvocation(IBaseResource theResource, String theResourceBody,
+ String theId, FhirContext theContext) {
RuntimeResourceDefinition def = theContext.getResourceDefinition(theResource);
String resourceName = def.getName();
@@ -132,32 +120,38 @@ public class MethodUtil {
return retVal;
}
- public static HttpPostClientInvocation createCreateInvocation(IBaseResource theResource, String theResourceBody, String theId, FhirContext theContext,
- Map> theIfNoneExistParams) {
+ public static HttpPostClientInvocation createCreateInvocation(IBaseResource theResource, String theResourceBody,
+ String theId, FhirContext theContext, Map> theIfNoneExistParams) {
HttpPostClientInvocation retVal = createCreateInvocation(theResource, theResourceBody, theId, theContext);
retVal.setIfNoneExistParams(theIfNoneExistParams);
return retVal;
}
- public static HttpPostClientInvocation createCreateInvocation(IBaseResource theResource, String theResourceBody, String theId, FhirContext theContext, String theIfNoneExistUrl) {
+ public static HttpPostClientInvocation createCreateInvocation(IBaseResource theResource, String theResourceBody,
+ String theId, FhirContext theContext, String theIfNoneExistUrl) {
HttpPostClientInvocation retVal = createCreateInvocation(theResource, theResourceBody, theId, theContext);
retVal.setIfNoneExistString(theIfNoneExistUrl);
return retVal;
}
- public static HttpPatchClientInvocation createPatchInvocation(FhirContext theContext, IIdType theId, PatchTypeEnum thePatchType, String theBody) {
+ public static HttpPatchClientInvocation createPatchInvocation(FhirContext theContext, IIdType theId,
+ PatchTypeEnum thePatchType, String theBody) {
return PatchMethodBinding.createPatchInvocation(theContext, theId, thePatchType, theBody);
}
- public static HttpPatchClientInvocation createPatchInvocation(FhirContext theContext, String theUrl, PatchTypeEnum thePatchType, String theBody) {
+ public static HttpPatchClientInvocation createPatchInvocation(FhirContext theContext, String theUrl,
+ PatchTypeEnum thePatchType, String theBody) {
return PatchMethodBinding.createPatchInvocation(theContext, theUrl, thePatchType, theBody);
}
- public static HttpPatchClientInvocation createPatchInvocation(FhirContext theContext, PatchTypeEnum thePatchType, String theBody, String theResourceType, Map> theMatchParams) {
- return PatchMethodBinding.createPatchInvocation(theContext, thePatchType, theBody, theResourceType, theMatchParams);
+ public static HttpPatchClientInvocation createPatchInvocation(FhirContext theContext, PatchTypeEnum thePatchType,
+ String theBody, String theResourceType, Map> theMatchParams) {
+ return PatchMethodBinding.createPatchInvocation(theContext, thePatchType, theBody, theResourceType,
+ theMatchParams);
}
- public static HttpPutClientInvocation createUpdateInvocation(FhirContext theContext, IBaseResource theResource, String theResourceBody, Map> theMatchParams) {
+ public static HttpPutClientInvocation createUpdateInvocation(FhirContext theContext, IBaseResource theResource,
+ String theResourceBody, Map> theMatchParams) {
String resourceType = theContext.getResourceDefinition(theResource).getName();
StringBuilder b = createUrl(resourceType, theMatchParams);
@@ -192,7 +186,8 @@ public class MethodUtil {
return b;
}
- public static HttpPutClientInvocation createUpdateInvocation(FhirContext theContext, IBaseResource theResource, String theResourceBody, String theMatchUrl) {
+ public static HttpPutClientInvocation createUpdateInvocation(FhirContext theContext, IBaseResource theResource,
+ String theResourceBody, String theMatchUrl) {
HttpPutClientInvocation retVal;
if (StringUtils.isBlank(theResourceBody)) {
retVal = new HttpPutClientInvocation(theContext, theResource, theMatchUrl);
@@ -205,7 +200,8 @@ public class MethodUtil {
return retVal;
}
- public static HttpPutClientInvocation createUpdateInvocation(IBaseResource theResource, String theResourceBody, IIdType theId, FhirContext theContext) {
+ public static HttpPutClientInvocation createUpdateInvocation(IBaseResource theResource, String theResourceBody,
+ IIdType theId, FhirContext theContext) {
String resourceName = theContext.getResourceDefinition(theResource).getName();
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(resourceName);
@@ -257,7 +253,8 @@ public class MethodUtil {
}
@SuppressWarnings("unchecked")
- public static List getResourceParameters(final FhirContext theContext, Method theMethod, Object theProvider, RestOperationTypeEnum theRestfulOperationTypeEnum) {
+ public static List getResourceParameters(final FhirContext theContext, Method theMethod,
+ Object theProvider, RestOperationTypeEnum theRestfulOperationTypeEnum) {
List parameters = new ArrayList();
Class>[] parameterTypes = theMethod.getParameterTypes();
@@ -282,7 +279,8 @@ public class MethodUtil {
parameterType = ReflectionUtil.getGenericCollectionTypeOfMethodParameter(theMethod, paramIndex);
}
if (Collection.class.isAssignableFrom(parameterType)) {
- throw new ConfigurationException("Argument #" + paramIndex + " of Method '" + theMethod.getName() + "' in type '" + theMethod.getDeclaringClass().getCanonicalName()
+ throw new ConfigurationException("Argument #" + paramIndex + " of Method '" + theMethod.getName()
+ + "' in type '" + theMethod.getDeclaringClass().getCanonicalName()
+ "' is of an invalid generic type (can not be a collection of a collection of a collection)");
}
}
@@ -301,7 +299,8 @@ public class MethodUtil {
parameter.setRequired(true);
parameter.setDeclaredTypes(((RequiredParam) nextAnnotation).targetTypes());
parameter.setCompositeTypes(((RequiredParam) nextAnnotation).compositeTypes());
- parameter.setChainlists(((RequiredParam) nextAnnotation).chainWhitelist(), ((RequiredParam) nextAnnotation).chainBlacklist());
+ parameter.setChainlists(((RequiredParam) nextAnnotation).chainWhitelist(),
+ ((RequiredParam) nextAnnotation).chainBlacklist());
parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType);
MethodUtil.extractDescription(parameter, annotations);
param = parameter;
@@ -311,7 +310,8 @@ public class MethodUtil {
parameter.setRequired(false);
parameter.setDeclaredTypes(((OptionalParam) nextAnnotation).targetTypes());
parameter.setCompositeTypes(((OptionalParam) nextAnnotation).compositeTypes());
- parameter.setChainlists(((OptionalParam) nextAnnotation).chainWhitelist(), ((OptionalParam) nextAnnotation).chainBlacklist());
+ parameter.setChainlists(((OptionalParam) nextAnnotation).chainWhitelist(),
+ ((OptionalParam) nextAnnotation).chainBlacklist());
parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType);
MethodUtil.extractDescription(parameter, annotations);
param = parameter;
@@ -324,15 +324,20 @@ public class MethodUtil {
if (parameterType == String.class) {
instantiableCollectionType = null;
specType = String.class;
- } else if ((parameterType != Include.class) || innerCollectionType == null || outerCollectionType != null) {
- throw new ConfigurationException("Method '" + theMethod.getName() + "' is annotated with @" + IncludeParam.class.getSimpleName() + " but has a type other than Collection<"
+ } else if ((parameterType != Include.class) || innerCollectionType == null
+ || outerCollectionType != null) {
+ throw new ConfigurationException("Method '" + theMethod.getName() + "' is annotated with @"
+ + IncludeParam.class.getSimpleName() + " but has a type other than Collection<"
+ Include.class.getSimpleName() + ">");
} else {
- instantiableCollectionType = (Class extends Collection>) CollectionBinder.getInstantiableCollectionType(innerCollectionType, "Method '" + theMethod.getName() + "'");
+ instantiableCollectionType = (Class extends Collection>) CollectionBinder
+ .getInstantiableCollectionType(innerCollectionType,
+ "Method '" + theMethod.getName() + "'");
specType = parameterType;
}
- param = new IncludeParameter((IncludeParam) nextAnnotation, instantiableCollectionType, specType);
+ param = new IncludeParameter((IncludeParam) nextAnnotation, instantiableCollectionType,
+ specType);
} else if (nextAnnotation instanceof ResourceParam) {
if (IBaseResource.class.isAssignableFrom(parameterType)) {
// good
@@ -362,10 +367,12 @@ public class MethodUtil {
param = new ElementsParameter();
} else if (nextAnnotation instanceof Since) {
param = new SinceParameter();
- ((SinceParameter) param).setType(theContext, parameterType, innerCollectionType, outerCollectionType);
+ ((SinceParameter) param).setType(theContext, parameterType, innerCollectionType,
+ outerCollectionType);
} else if (nextAnnotation instanceof At) {
param = new AtParameter();
- ((AtParameter) param).setType(theContext, parameterType, innerCollectionType, outerCollectionType);
+ ((AtParameter) param).setType(theContext, parameterType, innerCollectionType,
+ outerCollectionType);
} else if (nextAnnotation instanceof Count) {
param = new CountParameter();
} else if (nextAnnotation instanceof Sort) {
@@ -373,49 +380,56 @@ public class MethodUtil {
} else if (nextAnnotation instanceof TransactionParam) {
param = new TransactionParameter(theContext);
} else if (nextAnnotation instanceof ConditionalUrlParam) {
- param = new ConditionalParamBinder(theRestfulOperationTypeEnum, ((ConditionalUrlParam) nextAnnotation).supportsMultiple());
+ param = new ConditionalParamBinder(theRestfulOperationTypeEnum,
+ ((ConditionalUrlParam) nextAnnotation).supportsMultiple());
} else if (nextAnnotation instanceof OperationParam) {
Operation op = theMethod.getAnnotation(Operation.class);
param = new OperationParameter(theContext, op.name(), ((OperationParam) nextAnnotation));
} else if (nextAnnotation instanceof Validate.Mode) {
if (parameterType.equals(ValidationModeEnum.class) == false) {
- throw new ConfigurationException(
- "Parameter annotated with @" + Validate.class.getSimpleName() + "." + Validate.Mode.class.getSimpleName() + " must be of type " + ValidationModeEnum.class.getName());
+ throw new ConfigurationException("Parameter annotated with @"
+ + Validate.class.getSimpleName() + "." + Validate.Mode.class.getSimpleName()
+ + " must be of type " + ValidationModeEnum.class.getName());
}
- param = new OperationParameter(theContext, Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_MODE, 0, 1).setConverter(new IOperationParamConverter() {
- @Override
- public Object incomingServer(Object theObject) {
- if (isNotBlank(theObject.toString())) {
- ValidationModeEnum retVal = ValidationModeEnum.forCode(theObject.toString());
- if (retVal == null) {
- OperationParameter.throwInvalidMode(theObject.toString());
+ param = new OperationParameter(theContext, Constants.EXTOP_VALIDATE,
+ Constants.EXTOP_VALIDATE_MODE, 0, 1).setConverter(new IOperationParamConverter() {
+ @Override
+ public Object incomingServer(Object theObject) {
+ if (isNotBlank(theObject.toString())) {
+ ValidationModeEnum retVal = ValidationModeEnum
+ .forCode(theObject.toString());
+ if (retVal == null) {
+ OperationParameter.throwInvalidMode(theObject.toString());
+ }
+ return retVal;
+ }
+ return null;
}
- return retVal;
- }
- return null;
- }
- @Override
- public Object outgoingClient(Object theObject) {
- return ParametersUtil.createString(theContext, ((ValidationModeEnum) theObject).getCode());
- }
- });
+ @Override
+ public Object outgoingClient(Object theObject) {
+ return ParametersUtil.createString(theContext,
+ ((ValidationModeEnum) theObject).getCode());
+ }
+ });
} else if (nextAnnotation instanceof Validate.Profile) {
if (parameterType.equals(String.class) == false) {
- throw new ConfigurationException(
- "Parameter annotated with @" + Validate.class.getSimpleName() + "." + Validate.Profile.class.getSimpleName() + " must be of type " + String.class.getName());
+ throw new ConfigurationException("Parameter annotated with @"
+ + Validate.class.getSimpleName() + "." + Validate.Profile.class.getSimpleName()
+ + " must be of type " + String.class.getName());
}
- param = new OperationParameter(theContext, Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_PROFILE, 0, 1).setConverter(new IOperationParamConverter() {
- @Override
- public Object incomingServer(Object theObject) {
- return theObject.toString();
- }
+ param = new OperationParameter(theContext, Constants.EXTOP_VALIDATE,
+ Constants.EXTOP_VALIDATE_PROFILE, 0, 1).setConverter(new IOperationParamConverter() {
+ @Override
+ public Object incomingServer(Object theObject) {
+ return theObject.toString();
+ }
- @Override
- public Object outgoingClient(Object theObject) {
- return ParametersUtil.createString(theContext, theObject.toString());
- }
- });
+ @Override
+ public Object outgoingClient(Object theObject) {
+ return ParametersUtil.createString(theContext, theObject.toString());
+ }
+ });
} else {
continue;
}
@@ -425,9 +439,10 @@ public class MethodUtil {
}
if (param == null) {
- throw new ConfigurationException(
- "Parameter #" + ((paramIndex + 1)) + "/" + (parameterTypes.length) + " of method '" + theMethod.getName() + "' on type '" + theMethod.getDeclaringClass().getCanonicalName()
- + "' has no recognized FHIR interface parameter annotations. Don't know how to handle this parameter");
+ throw new ConfigurationException("Parameter #" + ((paramIndex + 1)) + "/" + (parameterTypes.length)
+ + " of method '" + theMethod.getName() + "' on type '"
+ + theMethod.getDeclaringClass().getCanonicalName()
+ + "' has no recognized FHIR interface parameter annotations. Don't know how to handle this parameter");
}
param.initializeTypes(theMethod, outerCollectionType, innerCollectionType, parameterType);
@@ -438,7 +453,8 @@ public class MethodUtil {
return parameters;
}
- public static void parseClientRequestResourceHeaders(IIdType theRequestedId, Map> theHeaders, IBaseResource resource) {
+ public static void parseClientRequestResourceHeaders(IIdType theRequestedId, Map> theHeaders,
+ IBaseResource resource) {
List lmHeaders = theHeaders.get(Constants.HEADER_LAST_MODIFIED_LOWERCASE);
if (lmHeaders != null && lmHeaders.size() > 0 && StringUtils.isNotBlank(lmHeaders.get(0))) {
String headerValue = lmHeaders.get(0);
@@ -484,7 +500,7 @@ public class MethodUtil {
List eTagHeaders = theHeaders.get(Constants.HEADER_ETAG_LC);
String eTagVersion = null;
if (eTagHeaders != null && eTagHeaders.size() > 0) {
- eTagVersion = parseETagValue(eTagHeaders.get(0));
+ eTagVersion = ParameterUtil.parseETagValue(eTagHeaders.get(0));
}
if (isNotBlank(eTagVersion)) {
if (existing == null || existing.isEmpty()) {
@@ -504,7 +520,7 @@ public class MethodUtil {
if (categoryHeaders != null && categoryHeaders.size() > 0 && StringUtils.isNotBlank(categoryHeaders.get(0))) {
TagList tagList = new TagList();
for (String header : categoryHeaders) {
- parseTagValue(tagList, header);
+ ParameterUtil.parseTagValue(tagList, header);
}
if (resource instanceof IResource) {
ResourceMetadataKeyEnum.TAG_LIST.put((IResource) resource, tagList);
@@ -517,31 +533,11 @@ public class MethodUtil {
}
}
- public static String parseETagValue(String value) {
- String eTagVersion;
- value = value.trim();
- if (value.length() > 1) {
- if (value.charAt(value.length() - 1) == '"') {
- if (value.charAt(0) == '"') {
- eTagVersion = value.substring(1, value.length() - 1);
- } else if (value.length() > 3 && value.charAt(0) == 'W' && value.charAt(1) == '/' && value.charAt(2) == '"') {
- eTagVersion = value.substring(3, value.length() - 1);
- } else {
- eTagVersion = value;
- }
- } else {
- eTagVersion = value;
- }
- } else {
- eTagVersion = value;
- }
- return eTagVersion;
- }
-
/**
* This is a utility method intended provided to help the JPA module.
*/
- public static IQueryParameterAnd> parseQueryParams(FhirContext theContext, RuntimeSearchParam theParamDef, String theUnqualifiedParamName, List theParameters) {
+ public static IQueryParameterAnd> parseQueryParams(FhirContext theContext, RuntimeSearchParam theParamDef,
+ String theUnqualifiedParamName, List theParameters) {
RestSearchParameterTypeEnum paramType = theParamDef.getParamType();
return parseQueryParams(theContext, paramType, theUnqualifiedParamName, theParameters);
}
@@ -549,119 +545,52 @@ public class MethodUtil {
/**
* This is a utility method intended provided to help the JPA module.
*/
- public static IQueryParameterAnd> parseQueryParams(FhirContext theContext, RestSearchParameterTypeEnum paramType, String theUnqualifiedParamName, List theParameters) {
+ public static IQueryParameterAnd> parseQueryParams(FhirContext theContext, RestSearchParameterTypeEnum paramType,
+ String theUnqualifiedParamName, List theParameters) {
QueryParameterAndBinder binder = null;
switch (paramType) {
- case COMPOSITE:
- throw new UnsupportedOperationException();
- case DATE:
- binder = new QueryParameterAndBinder(DateAndListParam.class, Collections.> emptyList());
- break;
- case NUMBER:
- binder = new QueryParameterAndBinder(NumberAndListParam.class, Collections.> emptyList());
- break;
- case QUANTITY:
- binder = new QueryParameterAndBinder(QuantityAndListParam.class, Collections.> emptyList());
- break;
- case REFERENCE:
- binder = new QueryParameterAndBinder(ReferenceAndListParam.class, Collections.> emptyList());
- break;
- case STRING:
- binder = new QueryParameterAndBinder(StringAndListParam.class, Collections.> emptyList());
- break;
- case TOKEN:
- binder = new QueryParameterAndBinder(TokenAndListParam.class, Collections.> emptyList());
- break;
- case URI:
- binder = new QueryParameterAndBinder(UriAndListParam.class, Collections.> emptyList());
- break;
- case HAS:
- binder = new QueryParameterAndBinder(HasAndListParam.class, Collections.> emptyList());
- break;
+ case COMPOSITE:
+ throw new UnsupportedOperationException();
+ case DATE:
+ binder = new QueryParameterAndBinder(DateAndListParam.class,
+ Collections.> emptyList());
+ break;
+ case NUMBER:
+ binder = new QueryParameterAndBinder(NumberAndListParam.class,
+ Collections.> emptyList());
+ break;
+ case QUANTITY:
+ binder = new QueryParameterAndBinder(QuantityAndListParam.class,
+ Collections.> emptyList());
+ break;
+ case REFERENCE:
+ binder = new QueryParameterAndBinder(ReferenceAndListParam.class,
+ Collections.> emptyList());
+ break;
+ case STRING:
+ binder = new QueryParameterAndBinder(StringAndListParam.class,
+ Collections.> emptyList());
+ break;
+ case TOKEN:
+ binder = new QueryParameterAndBinder(TokenAndListParam.class,
+ Collections.> emptyList());
+ break;
+ case URI:
+ binder = new QueryParameterAndBinder(UriAndListParam.class,
+ Collections.> emptyList());
+ break;
+ case HAS:
+ binder = new QueryParameterAndBinder(HasAndListParam.class,
+ Collections.> emptyList());
+ break;
}
// FIXME null access
return binder.parse(theContext, theUnqualifiedParamName, theParameters);
}
- public static void parseTagValue(TagList tagList, String nextTagComplete) {
- StringBuilder next = new StringBuilder(nextTagComplete);
- parseTagValue(tagList, nextTagComplete, next);
- }
-
- private static void parseTagValue(TagList theTagList, String theCompleteHeaderValue, StringBuilder theBuffer) {
- int firstSemicolon = theBuffer.indexOf(";");
- int deleteTo;
- if (firstSemicolon == -1) {
- firstSemicolon = theBuffer.indexOf(",");
- if (firstSemicolon == -1) {
- firstSemicolon = theBuffer.length();
- deleteTo = theBuffer.length();
- } else {
- deleteTo = firstSemicolon;
- }
- } else {
- deleteTo = firstSemicolon + 1;
- }
-
- String term = theBuffer.substring(0, firstSemicolon);
- String scheme = null;
- String label = null;
- if (isBlank(term)) {
- return;
- }
-
- theBuffer.delete(0, deleteTo);
- while (theBuffer.length() > 0 && theBuffer.charAt(0) == ' ') {
- theBuffer.deleteCharAt(0);
- }
-
- while (theBuffer.length() > 0) {
- boolean foundSomething = false;
- if (theBuffer.length() > SCHEME.length() && theBuffer.substring(0, SCHEME.length()).equals(SCHEME)) {
- int closeIdx = theBuffer.indexOf("\"", SCHEME.length());
- scheme = theBuffer.substring(SCHEME.length(), closeIdx);
- theBuffer.delete(0, closeIdx + 1);
- foundSomething = true;
- }
- if (theBuffer.length() > LABEL.length() && theBuffer.substring(0, LABEL.length()).equals(LABEL)) {
- int closeIdx = theBuffer.indexOf("\"", LABEL.length());
- label = theBuffer.substring(LABEL.length(), closeIdx);
- theBuffer.delete(0, closeIdx + 1);
- foundSomething = true;
- }
- // TODO: support enc2231-string as described in
- // http://tools.ietf.org/html/draft-johnston-http-category-header-02
- // TODO: support multiple tags in one header as described in
- // http://hl7.org/implement/standards/fhir/http.html#tags
-
- while (theBuffer.length() > 0 && (theBuffer.charAt(0) == ' ' || theBuffer.charAt(0) == ';')) {
- theBuffer.deleteCharAt(0);
- }
-
- if (!foundSomething) {
- break;
- }
- }
-
- if (theBuffer.length() > 0 && theBuffer.charAt(0) == ',') {
- theBuffer.deleteCharAt(0);
- while (theBuffer.length() > 0 && theBuffer.charAt(0) == ' ') {
- theBuffer.deleteCharAt(0);
- }
- theTagList.add(new Tag(scheme, term, label));
- parseTagValue(theTagList, theCompleteHeaderValue, theBuffer);
- } else {
- theTagList.add(new Tag(scheme, term, label));
- }
-
- if (theBuffer.length() > 0) {
- ourLog.warn("Ignoring extra text at the end of " + Constants.HEADER_CATEGORY + " tag '" + theBuffer.toString() + "' - Complete tag value was: " + theCompleteHeaderValue);
- }
-
- }
-
- public static MethodOutcome process2xxResponse(FhirContext theContext, int theResponseStatusCode, String theResponseMimeType, Reader theResponseReader, Map> theHeaders) {
+ public static MethodOutcome process2xxResponse(FhirContext theContext, int theResponseStatusCode,
+ String theResponseMimeType, Reader theResponseReader, Map> theHeaders) {
List locationHeaders = new ArrayList();
List lh = theHeaders.get(Constants.HEADER_LOCATION_LC);
if (lh != null) {
@@ -706,34 +635,16 @@ public class MethodUtil {
}
} else {
- BaseOutcomeReturningMethodBinding.ourLog.debug("Ignoring response content of type: {}", theResponseMimeType);
+ BaseOutcomeReturningMethodBinding.ourLog.debug("Ignoring response content of type: {}",
+ theResponseMimeType);
}
}
return retVal;
}
- public static IQueryParameterOr> singleton(final IQueryParameterType theParam, final String theParamName) {
- return new IQueryParameterOr() {
- @Override
- public List getValuesAsQueryTokens() {
- return Collections.singletonList(theParam);
- }
-
- @Override
- public void setValuesAsQueryTokens(FhirContext theContext, String theParamName, QualifiedParamList theParameters) {
- if (theParameters.isEmpty()) {
- return;
- }
- if (theParameters.size() > 1) {
- throw new IllegalArgumentException("Type " + theParam.getClass().getCanonicalName() + " does not support multiple values");
- }
- theParam.setValueAsQueryToken(theContext, theParamName, theParameters.getQualifier(), theParameters.get(0));
- }
- };
- }
-
- public static void addAcceptHeaderToRequest(EncodingEnum theEncoding, IHttpRequest theHttpRequest, FhirContext theContext) {
+ public static void addAcceptHeaderToRequest(EncodingEnum theEncoding, IHttpRequest theHttpRequest,
+ FhirContext theContext) {
if (theEncoding == null) {
if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU2_1) == false) {
theHttpRequest.addHeader(Constants.HEADER_ACCEPT, Constants.HEADER_ACCEPT_VALUE_XML_OR_JSON_LEGACY);
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/OperationMethodBinding.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/OperationMethodBinding.java
index 493678eeebe..99fba7898da 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/OperationMethodBinding.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/OperationMethodBinding.java
@@ -50,6 +50,7 @@ import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.client.impl.BaseHttpClientInvocation;
+import ca.uhn.fhir.rest.param.ParameterUtil;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.util.FhirTerser;
@@ -75,7 +76,7 @@ public class OperationMethodBinding extends BaseResourceReturningMethodBinding {
myBundleType = theBundleType;
myIdempotent = theIdempotent;
- myIdParamIndex = MethodUtil.findIdParameterIndex(theMethod, getContext());
+ myIdParamIndex = ParameterUtil.findIdParameterIndex(theMethod, getContext());
if (myIdParamIndex != null) {
for (Annotation next : theMethod.getParameterAnnotations()[myIdParamIndex]) {
if (next instanceof IdParam) {
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/QueryParameterTypeBinder.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/QueryParameterTypeBinder.java
index 4565aec2d13..861dfd972c2 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/QueryParameterTypeBinder.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/QueryParameterTypeBinder.java
@@ -29,6 +29,7 @@ import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.IQueryParameterOr;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.rest.api.QualifiedParamList;
+import ca.uhn.fhir.rest.param.ParameterUtil;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
@@ -42,7 +43,7 @@ final class QueryParameterTypeBinder extends BaseBinder imp
@Override
public List> encode(FhirContext theContext, IQueryParameterType theValue) throws InternalErrorException {
IQueryParameterType param = theValue;
- List> retVal = Collections.singletonList(MethodUtil.singleton(param, null));
+ List> retVal = Collections.singletonList(ParameterUtil.singleton(param, null));
return (List>) retVal;
}
diff --git a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/ReadMethodBinding.java b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/ReadMethodBinding.java
index f30d0428a0f..68c9d9c2193 100644
--- a/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/ReadMethodBinding.java
+++ b/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/method/ReadMethodBinding.java
@@ -23,11 +23,16 @@ package ca.uhn.fhir.rest.client.method;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.Validate;
-import org.hl7.fhir.instance.model.api.*;
+import org.hl7.fhir.instance.model.api.IBaseBinary;
+import org.hl7.fhir.instance.model.api.IBaseResource;
+import org.hl7.fhir.instance.model.api.IIdType;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirContext;
@@ -35,8 +40,11 @@ import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
-import ca.uhn.fhir.rest.annotation.*;
+import ca.uhn.fhir.rest.annotation.Elements;
+import ca.uhn.fhir.rest.annotation.IdParam;
+import ca.uhn.fhir.rest.annotation.Read;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
+import ca.uhn.fhir.rest.param.ParameterUtil;
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
public class ReadMethodBinding extends BaseResourceReturningMethodBinding implements IClientResponseHandlerHandlesBinary