Class InferenceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.opendaylight.yangtools.yang.parser.spi.source.SourceException
org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException
- All Implemented Interfaces:
Serializable
Thrown when there is an inference error.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInferenceException(@NonNull String message, @NonNull CommonStmtCtx stmt) InferenceException(@NonNull String message, @NonNull CommonStmtCtx stmt, Throwable cause) InferenceException(@NonNull String message, @NonNull StatementSourceReference source) InferenceException(@NonNull String message, @NonNull StatementSourceReference source, Throwable cause) InferenceException(@NonNull CommonStmtCtx stmt, @NonNull String format, Object... args) InferenceException(@NonNull StatementSourceReference source, @NonNull String format, Object... args) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidthrowIf(boolean expression, @NonNull CommonStmtCtx stmt, @NonNull String format, Object... args) Throw an instance of this exception if an expression evaluates to true.static voidthrowIf(boolean expression, @NonNull StatementSourceReference source, @NonNull String format, Object... args) Throw an instance of this exception if an expression evaluates to true.Methods inherited from class org.opendaylight.yangtools.yang.parser.spi.source.SourceException
getSourceReference, throwIfNull, throwIfNull, unwrap, unwrapMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InferenceException
-
InferenceException
public InferenceException(@NonNull String message, @NonNull StatementSourceReference source, Throwable cause) -
InferenceException
public InferenceException(@NonNull StatementSourceReference source, @NonNull String format, Object... args) -
InferenceException
-
InferenceException
-
InferenceException
-
-
Method Details
-
throwIf
public static void throwIf(boolean expression, @NonNull StatementSourceReference source, @NonNull String format, Object... args) Throw an instance of this exception if an expression evaluates to true. If the expression evaluates to false, this method does nothing.- Parameters:
expression- Expression to be evaluatedsource- Statement source referenceformat- Format string, according toString.format(String, Object...).args- Format string arguments, according toString.format(String, Object...)- Throws:
InferenceException- if the expression evaluates to true.
-
throwIf
public static void throwIf(boolean expression, @NonNull CommonStmtCtx stmt, @NonNull String format, Object... args) Throw an instance of this exception if an expression evaluates to true. If the expression evaluates to false, this method does nothing.- Parameters:
expression- Expression to be evaluatedstmt- Statement contextformat- Format string, according toString.format(String, Object...).args- Format string arguments, according toString.format(String, Object...)- Throws:
InferenceException- if the expression evaluates to true.
-