Package groovy.lang
Class MissingPropertyException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
groovy.lang.GroovyRuntimeException
groovy.lang.MissingPropertyException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
IllegalPropertyAccessException,MissingPropertyExceptionNoStack,ReadOnlyPropertyException
An exception occurred if a dynamic property dispatch fails with an unknown property.
Note that the Missing*Exception classes were named for consistency and to avoid conflicts with JDK exceptions of the same name.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMissingPropertyException(String message) Creates an exception with a custom message.MissingPropertyException(String property, Class type) Creates an exception for a missing property.MissingPropertyException(String property, Class type, Throwable cause) Creates an exception for a missing property with an underlying cause.MissingPropertyException(String message, String property, Class type) Creates an exception with a custom message for a missing property. -
Method Summary
Modifier and TypeMethodDescriptionReturns the detail message without any location suffix.getType()Methods inherited from class groovy.lang.GroovyRuntimeException
getLocationText, getMessage, getModule, getNode, setModuleMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
MPE
Sentinel used internally when handling missing properties.
-
-
Constructor Details
-
MissingPropertyException
Creates an exception for a missing property.- Parameters:
property- the missing property nametype- the target type
-
MissingPropertyException
Creates an exception for a missing property with an underlying cause.- Parameters:
property- the missing property nametype- the target typecause- the underlying cause
-
MissingPropertyException
Creates an exception with a custom message.- Parameters:
message- the detail message
-
MissingPropertyException
Creates an exception with a custom message for a missing property.- Parameters:
message- the detail messageproperty- the missing property nametype- the target type
-
-
Method Details
-
getMessageWithoutLocationText
Returns the detail message without any location suffix.- Overrides:
getMessageWithoutLocationTextin classGroovyRuntimeException- Returns:
- the formatted detail message
-
getProperty
- Returns:
- the name of the property that could not be found
-
getType
- Returns:
- the class which cannot answer the property
-