Introduce formatting methods for SourceException
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / InvalidSubstatementException.java
index c8678eca20e7e23489b846f8109225fff0bd2416..3412ee7175233ee63f2695b5d0ba1869702122ef 100644 (file)
@@ -17,11 +17,17 @@ import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReferenc
 public class InvalidSubstatementException extends SourceException {
     private static final long serialVersionUID = 1L;
 
-    public InvalidSubstatementException(@Nonnull final String message, @Nonnull final StatementSourceReference source, final Throwable cause) {
+    public InvalidSubstatementException(@Nonnull final String message, @Nonnull final StatementSourceReference source,
+            final Throwable cause) {
         super(message, source, cause);
     }
 
     public InvalidSubstatementException(@Nonnull final String message, @Nonnull final StatementSourceReference source) {
         super(message, source);
     }
+
+    public InvalidSubstatementException(@Nonnull final StatementSourceReference source, @Nonnull final String format,
+            final Object... args) {
+        this(String.format(format, args), source);
+    }
 }