public static void extractDescription(SearchParameter theParameter, Annotation[] theAnnotations) { for (Annotation annotation : theAnnotations) { if (annotation instanceof Description) { Description desc = (Description) annotation; if (isNotBlank(desc.formalDefinition())) { theParameter.setDescription(desc.formalDefinition()); } else { theParameter.setDescription(desc.shortDefinition()); } } } }
public static void extractDescription(SearchParameter theParameter, Annotation[] theAnnotations) { for (Annotation annotation : theAnnotations) { if (annotation instanceof Description) { Description desc = (Description) annotation; if (isNotBlank(desc.formalDefinition())) { theParameter.setDescription(desc.formalDefinition()); } else { theParameter.setDescription(desc.shortDefinition()); } } } }
public SearchMethodBinding(Class<? extends IBaseResource> theReturnResourceType, Class<? extends IBaseResource> theResourceProviderResourceType, Method theMethod, FhirContext theContext, Object theProvider) { super(theReturnResourceType, theMethod, theContext, theProvider); Search search = theMethod.getAnnotation(Search.class); this.myQueryName = StringUtils.defaultIfBlank(search.queryName(), null); this.myCompartmentName = StringUtils.defaultIfBlank(search.compartmentName(), null); this.myIdParamIndex = ParameterUtil.findIdParameterIndex(theMethod, getContext()); this.myAllowUnknownParams = search.allowUnknownParams(); Description desc = theMethod.getAnnotation(Description.class); if (desc != null) { if (isNotBlank(desc.formalDefinition())) { myDescription = StringUtils.defaultIfBlank(desc.formalDefinition(), null); } else { myDescription = StringUtils.defaultIfBlank(desc.shortDefinition(), null); } } /* * Only compartment searching methods may have an ID parameter */ if (isBlank(myCompartmentName) && myIdParamIndex != null) { String msg = theContext.getLocalizer().getMessage(getClass().getName() + ".idWithoutCompartment", theMethod.getName(), theMethod.getDeclaringClass()); throw new ConfigurationException(msg); } if (theResourceProviderResourceType != null) { this.myResourceProviderResourceName = theContext.getResourceDefinition(theResourceProviderResourceType).getName(); } else { this.myResourceProviderResourceName = null; } }
if (isNotBlank(desc.formalDefinition())) { myDescription = StringUtils.defaultIfBlank(desc.formalDefinition(), null); } else { myDescription = StringUtils.defaultIfBlank(desc.shortDefinition(), null);
BaseRuntimeDeclaredChildDefinition(Field theField, Child theChildAnnotation, Description theDescriptionAnnotation, String theElementName) throws ConfigurationException { super(); Validate.notNull(theField, "No field speficied"); ValidateUtil.isGreaterThanOrEqualTo(theChildAnnotation.min(), 0, "Min must be >= 0"); Validate.isTrue(theChildAnnotation.max() == -1 || theChildAnnotation.max() >= theChildAnnotation.min(), "Max must be >= Min (unless it is -1 / unlimited)"); Validate.notBlank(theElementName, "Element name must not be blank"); myField = theField; myMin = theChildAnnotation.min(); myMax = theChildAnnotation.max(); mySummary = theChildAnnotation.summary(); myModifier = theChildAnnotation.modifier(); myElementName = theElementName; if (theDescriptionAnnotation != null) { myShortDefinition = theDescriptionAnnotation.shortDefinition(); myFormalDefinition = theDescriptionAnnotation.formalDefinition(); } else { myShortDefinition = null; myFormalDefinition = null; } myField.setAccessible(true); if (List.class.equals(myField.getType())) { // TODO: verify that generic type is IElement myAccessor = new FieldListAccessor(); myMutator = new FieldListMutator(); } else { myAccessor = new FieldPlainAccessor(); myMutator = new FieldPlainMutator(); } }
myDescription = description.formalDefinition(); if (isBlank(myDescription)) { myDescription = description.shortDefinition();
myDescription = description.formalDefinition(); if (isBlank(myDescription)) { myDescription = description.shortDefinition();
public static void extractDescription(SearchParameter theParameter, Annotation[] theAnnotations) { for (Annotation annotation : theAnnotations) { if (annotation instanceof Description) { Description desc = (Description) annotation; if (isNotBlank(desc.formalDefinition())) { theParameter.setDescription(desc.formalDefinition()); } else { theParameter.setDescription(desc.shortDefinition()); } } } }
public static void extractDescription(SearchParameter theParameter, Annotation[] theAnnotations) { for (Annotation annotation : theAnnotations) { if (annotation instanceof Description) { Description desc = (Description) annotation; if (isNotBlank(desc.formalDefinition())) { theParameter.setDescription(desc.formalDefinition()); } else { theParameter.setDescription(desc.shortDefinition()); } } } }
public SearchMethodBinding(Class<? extends IBaseResource> theReturnResourceType, Class<? extends IBaseResource> theResourceProviderResourceType, Method theMethod, FhirContext theContext, Object theProvider) { super(theReturnResourceType, theMethod, theContext, theProvider); Search search = theMethod.getAnnotation(Search.class); this.myQueryName = StringUtils.defaultIfBlank(search.queryName(), null); this.myCompartmentName = StringUtils.defaultIfBlank(search.compartmentName(), null); this.myIdParamIndex = ParameterUtil.findIdParameterIndex(theMethod, getContext()); this.myAllowUnknownParams = search.allowUnknownParams(); Description desc = theMethod.getAnnotation(Description.class); if (desc != null) { if (isNotBlank(desc.formalDefinition())) { myDescription = StringUtils.defaultIfBlank(desc.formalDefinition(), null); } else { myDescription = StringUtils.defaultIfBlank(desc.shortDefinition(), null); } } /* * Only compartment searching methods may have an ID parameter */ if (isBlank(myCompartmentName) && myIdParamIndex != null) { String msg = theContext.getLocalizer().getMessage(getClass().getName() + ".idWithoutCompartment", theMethod.getName(), theMethod.getDeclaringClass()); throw new ConfigurationException(msg); } if (theResourceProviderResourceType != null) { this.myResourceProviderResourceName = theContext.getResourceDefinition(theResourceProviderResourceType).getName(); } else { this.myResourceProviderResourceName = null; } }
if (isNotBlank(desc.formalDefinition())) { myDescription = StringUtils.defaultIfBlank(desc.formalDefinition(), null); } else { myDescription = StringUtils.defaultIfBlank(desc.shortDefinition(), null);
BaseRuntimeDeclaredChildDefinition(Field theField, Child theChildAnnotation, Description theDescriptionAnnotation, String theElementName) throws ConfigurationException { super(); Validate.notNull(theField, "No field speficied"); ValidateUtil.isGreaterThanOrEqualTo(theChildAnnotation.min(), 0, "Min must be >= 0"); Validate.isTrue(theChildAnnotation.max() == -1 || theChildAnnotation.max() >= theChildAnnotation.min(), "Max must be >= Min (unless it is -1 / unlimited)"); Validate.notBlank(theElementName, "Element name must not be blank"); myField = theField; myMin = theChildAnnotation.min(); myMax = theChildAnnotation.max(); mySummary = theChildAnnotation.summary(); myModifier = theChildAnnotation.modifier(); myElementName = theElementName; if (theDescriptionAnnotation != null) { myShortDefinition = theDescriptionAnnotation.shortDefinition(); myFormalDefinition = theDescriptionAnnotation.formalDefinition(); } else { myShortDefinition = null; myFormalDefinition = null; } myField.setAccessible(true); if (List.class.equals(myField.getType())) { // TODO: verify that generic type is IElement myAccessor = new FieldListAccessor(); myMutator = new FieldListMutator(); } else { myAccessor = new FieldPlainAccessor(); myMutator = new FieldPlainMutator(); } }
myDescription = description.formalDefinition(); if (isBlank(myDescription)) { myDescription = description.shortDefinition();
myDescription = description.formalDefinition(); if (isBlank(myDescription)) { myDescription = description.shortDefinition();