Skip to content

Commit

Permalink
More metaschema-java refactoring updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed Nov 2, 2023
1 parent 089f908 commit 22c47f9
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import gov.nist.secauto.metaschema.cli.processor.CLIProcessor.CallingContext;
import gov.nist.secauto.metaschema.cli.processor.command.ICommandExecutor;
import gov.nist.secauto.metaschema.core.model.constraint.IConstraintSet;
import gov.nist.secauto.metaschema.core.model.xml.ExternalConstraintsModulePostProcessor;
import gov.nist.secauto.metaschema.core.util.CollectionUtil;
import gov.nist.secauto.metaschema.databind.IBindingContext;
import gov.nist.secauto.oscal.lib.OscalBindingContext;

Expand Down Expand Up @@ -69,7 +71,16 @@ private OscalCommandExecutor(

@Override
protected IBindingContext getBindingContext(@NonNull Set<IConstraintSet> constraintSets) {
return constraintSets.isEmpty() ? OscalBindingContext.instance() : new OscalBindingContext(constraintSets);
IBindingContext retval;
if (constraintSets.isEmpty()) {
retval = OscalBindingContext.instance();
} else {
ExternalConstraintsModulePostProcessor postProcessor
= new ExternalConstraintsModulePostProcessor(constraintSets);

retval = new OscalBindingContext(CollectionUtil.singletonList(postProcessor));
}
return retval;
}

@Override
Expand Down

0 comments on commit 22c47f9

Please sign in to comment.