public ValidateMethodBindingDstu2Plus(Class<?> theReturnResourceType, Class<? extends IBaseResource> theReturnTypeFromRp, Method theMethod, FhirContext theContext, Object theProvider, Validate theAnnotation) { super(theReturnResourceType, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION); List<IParameter> newParams = new ArrayList<IParameter>(); int idx = 0; for (IParameter next : getParameters()) { if (next instanceof ResourceParameter) { if (IBaseResource.class.isAssignableFrom(((ResourceParameter) next).getResourceType())) { Class<?> parameterType = theMethod.getParameterTypes()[idx]; if (String.class.equals(parameterType) || EncodingEnum.class.equals(parameterType)) { newParams.add(next); } else { OperationParameter parameter = new OperationParameter(theContext, Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_RESOURCE, 0, 1); parameter.initializeTypes(theMethod, null, null, parameterType); newParams.add(parameter); } } else { newParams.add(next); } } else { newParams.add(next); } idx++; } setParameters(newParams); }
myResourceType = resourceParameter.getResourceType();
public ValidateMethodBindingDstu2Plus(Class<?> theReturnResourceType, Class<? extends IBaseResource> theReturnTypeFromRp, Method theMethod, FhirContext theContext, Object theProvider, Validate theAnnotation) { super(theReturnResourceType, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION); List<IParameter> newParams = new ArrayList<IParameter>(); int idx = 0; for (IParameter next : getParameters()) { if (next instanceof ResourceParameter) { if (IBaseResource.class.isAssignableFrom(((ResourceParameter) next).getResourceType())) { Class<?> parameterType = theMethod.getParameterTypes()[idx]; if (String.class.equals(parameterType) || EncodingEnum.class.equals(parameterType)) { newParams.add(next); } else { OperationParameter parameter = new OperationParameter(theContext, Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_RESOURCE, 0, 1); parameter.initializeTypes(theMethod, null, null, parameterType); newParams.add(parameter); } } else { newParams.add(next); } } else { newParams.add(next); } idx++; } setParameters(newParams); }
myResourceType = resourceParameter.getResourceType();