public class DependentTypesError extends Object
IMPORTANT: This is not an Exception. It is a regular class that is returned, not thrown. The
errors are not thrown so that they are only reported once rather than every time the annotation
is parsed. See DependentTypesHelper
for more details.
Modifier and Type | Field and Description |
---|---|
String |
error
An error message about that expression.
|
String |
expression
The expression that is unparseable or otherwise problematic.
|
static @Format(value={INT,GENERAL}) String |
FORMAL_PARAM_NAME_STRING
How to format warnings about use of formal parameter name.
|
Constructor and Description |
---|
DependentTypesError(String expression,
JavaExpressionParseUtil.JavaExpressionParseException e)
Create a DependentTypesError for the given expression and exception.
|
DependentTypesError(String expression,
String error)
Create a DependentTypesError for the given expression and error message.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(@Nullable Object o) |
String |
format()
Like toString, but uses better formatting sometimes.
|
int |
hashCode() |
static boolean |
isExpressionError(String expression)
Returns whether or not the given expression string is an error.
|
String |
toString() |
static DependentTypesError |
unparse(String formattedError)
Create a DependentTypesError by parsing a printed one.
|
public static final @Format(value={INT,GENERAL}) String FORMAL_PARAM_NAME_STRING
public final String expression
public final String error
public DependentTypesError(String expression, String error)
expression
- the incorrect Java expressionerror
- an error message about the expressionpublic DependentTypesError(String expression, JavaExpressionParseUtil.JavaExpressionParseException e)
expression
- the incorrect Java expressione
- wraps an error message about the expressionpublic static boolean isExpressionError(String expression)
expression
- expression string to testpublic static DependentTypesError unparse(String formattedError)
formattedError
- the toString() representation of a DependentTypesErrorpublic String format()