use of org.candlepin.resteasy.parameter.CandlepinParameterUnmarshaller in project candlepin by candlepin.
the class OwnerResourceTest method createKeyValueParam.
@QueryParam("test-attr")
@CandlepinParam(type = KeyValueParameter.class)
private KeyValueParameter createKeyValueParam(String key, String val) throws Exception {
// Can't create the KeyValueParam directly as the parse method
// is package protected -- create one via the unmarshaller so we don't have to
// change the visibility of the parse method.
Annotation[] annotations = this.getClass().getDeclaredMethod("createKeyValueParam", String.class, String.class).getAnnotations();
CandlepinParameterUnmarshaller unmarshaller = new CandlepinParameterUnmarshaller();
unmarshaller.setAnnotations(annotations);
return (KeyValueParameter) unmarshaller.fromString(key + ":" + val);
}
Aggregations