- if (writer.getPhase().equals(ModelProcessingPhase.FULL_DECLARATION)) {
- throw new SourceException(String.format("%s is not a YIN statement or use of extension.",
- identifier.getLocalName()), ref);
- } else {
- //otherwise skip it (statement not to be read yet)
- action = false;
- toBeSkipped.add(getElementFullName(inputReader));
- }
+ SourceException.throwIf(writer.getPhase().equals(ModelProcessingPhase.FULL_DECLARATION), ref,
+ "%s is not a YIN statement or use of extension.", identifier.getLocalName());
+
+ //otherwise skip it (statement not to be read yet)
+ action = false;
+ toBeSkipped.add(getElementFullName(inputReader));