cleaned up getting the return type for the resource method
This commit is contained in:
parent
7e979449b2
commit
f2d530112e
|
@ -36,8 +36,8 @@ public class ResourceMethod {
|
|||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
public IResource getResourceType() throws IllegalAccessException, InstantiationException {
|
||||
return (IResource)resourceType.newInstance();
|
||||
public Class getResourceType() throws IllegalAccessException, InstantiationException {
|
||||
return resourceType.getClass();
|
||||
}
|
||||
|
||||
public RequestType getRequestType() {
|
||||
|
|
|
@ -165,7 +165,7 @@ public class Service extends HttpServlet {
|
|||
ResourceMethod resourceMethod = resource.getMethod(params.keySet());
|
||||
if (null == resourceMethod) throw new MethodNotFoundException("No resource method available for the supplied parameters " + params);
|
||||
|
||||
FhirContext ctx = new FhirContext(resourceMethod.getResourceType().getClass());
|
||||
FhirContext ctx = new FhirContext(resourceMethod.getResourceType());
|
||||
XmlParser p = new XmlParser(ctx);
|
||||
response.getWriter().write(p.encodeResourceToString(resourceMethod.invoke(params)));
|
||||
} catch (Throwable t) {
|
||||
|
|
Loading…
Reference in New Issue