|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception org.jwalk.JWalkException org.jwalk.GeneratorException
public class GeneratorException
GeneratorException signals when a Generator could not synthesise a value.
This exception may be raised if eventually none of the generators know how
to synthesis a value of a given type, or if the type itself refuses
permission to be instantiated. This is the most common kind of exception,
arising from requests to synthesise values for unknown interface-types, or
for types which are abstract, or subject to security restrictions.
Furthermore, a GeneratorException may be raised if the JWalker engine can
detect that a (custom) generator has failed internally. This may happen,
since users may supply their own generators. The exception may be queried
before it is handled, to support giving different feedback.
If creationFailed()
is true, the synthesis attempt failed for
the given type; and the most likely remedy is to provide a custom generator.
If generatorFailed()
is true, one of the custom generators is
most likely to have failed internally, and needs reparing. Access is
provided to the class type for which a value could not be synthesised.
Constructor Summary | |
---|---|
GeneratorException(java.lang.Class<?> type)
Creates a GeneratorException reporting the inability to synthesise a value for a particular type. |
|
GeneratorException(java.lang.Class<?> type,
Generator generator)
Creates a GeneratorException reporting that a (custom) generator failed during synthesis. |
Method Summary | |
---|---|
boolean |
creationFailed()
Reports that synthesis failed for a given type. |
boolean |
generatorFailed()
Reports that the generator failed in its operation. |
Generator |
getGenerator()
Returns the generator which failed during execution, or null. |
java.lang.Class<?> |
getType()
Returns the type that could not be synthesised. |
Methods inherited from class org.jwalk.JWalkException |
---|
getError |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GeneratorException(java.lang.Class<?> type)
type
- the type that could not be synthesised.public GeneratorException(java.lang.Class<?> type, Generator generator)
type
- the type that could not be synthesised.generator
- the (custom) generator that failed internally.Method Detail |
---|
public boolean creationFailed()
public boolean generatorFailed()
public java.lang.Class<?> getType()
public Generator getGenerator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |