Skip to content

Commit

Permalink
Issue #2424 - updates per PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: John T.E. Timm <[email protected]>
  • Loading branch information
JohnTimm committed Jun 1, 2021
1 parent 88cd2d5 commit 45807ca
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ protected void handleCode(Code.Builder code) throws IllegalAccessException, Ille
Class<?>[] classes = elementClass.getClasses();
// If the element has a ValueSet, set one of the values randomly
for (Class<?> clazz : classes) {
if ("ValueSet".equals(clazz.getSimpleName())) {
if ("Value".equals(clazz.getSimpleName())) {
Object[] enumConstants = clazz.getEnumConstants();
Object enumConstant = enumConstants[ThreadLocalRandom.current().nextInt(0, enumConstants.length)];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@
public abstract class AbstractBuilder<T> implements Builder<T> {
protected boolean validating = true;

/**
* Set the validating builder indicator for this builder
*
* <p>A validating builder performs validation during object construction
*
* @param validating
* the validating builder indicator
*/
public void setValidating(boolean validating) {
this.validating = validating;
}

/**
* Indicates whether this builder is a validating builder
*
* @return
* true if this builder is a validating builder, false otherwise
*/
public boolean isValidating() {
return validating;
}
Expand Down
12 changes: 12 additions & 0 deletions fhir-model/src/main/java/com/ibm/fhir/model/parser/FHIRParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.ibm.fhir.model.format.Format;
import com.ibm.fhir.model.parser.exception.FHIRParserException;
import com.ibm.fhir.model.resource.Resource;
import com.ibm.fhir.model.util.ValidationSupport;

/**
* Parse FHIR resource representations into fhir-model objects
Expand Down Expand Up @@ -47,8 +48,19 @@ public interface FHIRParser {
/**
* Set the validating parser indicator for this parser
*
* <p>A validating parser performs basic validation during parsing / deserialization of the input format including:
* <ul>
* <li>element cardinality checking</li>
* <li>element type checking</li>
* <li>element value checking</li>
* <li>choice element type checking</li>
* <li>reference target type checking (syntax only)</li>
* <li>element value set membership checking (limited)</li>
* </ul>
*
* @param validating
* the validating parser indicator
* @see ValidationSupport
*/
void setValidating(boolean validating);

Expand Down

0 comments on commit 45807ca

Please sign in to comment.