diff options
Diffstat (limited to 'src/main/java/ftbsc/lll/exceptions')
-rw-r--r-- | src/main/java/ftbsc/lll/exceptions/NotAProxyException.java | 7 | ||||
-rw-r--r-- | src/main/java/ftbsc/lll/exceptions/OrphanElementException.java | 25 |
2 files changed, 28 insertions, 4 deletions
diff --git a/src/main/java/ftbsc/lll/exceptions/NotAProxyException.java b/src/main/java/ftbsc/lll/exceptions/NotAProxyException.java index 1ce3c0f..f3e40a7 100644 --- a/src/main/java/ftbsc/lll/exceptions/NotAProxyException.java +++ b/src/main/java/ftbsc/lll/exceptions/NotAProxyException.java @@ -1,17 +1,16 @@ package ftbsc.lll.exceptions; import ftbsc.lll.processor.annotations.Find; -import ftbsc.lll.proxies.impl.FieldProxy; -import ftbsc.lll.proxies.impl.MethodProxy; /** * Thrown when a method is annotated with {@link Find} but does not - * return a {@link MethodProxy} or a {@link FieldProxy} + * return a known instance of {@link ftbsc.lll.proxies.AbstractProxy}. + * @since 0.5.0 */ public class NotAProxyException extends RuntimeException { /** - * Constructs a exception for the specified method. + * Constructs an exception for the specified method. * @param parent the FQN of the class containing the method * @param method the name of the method wrongly annotated */ diff --git a/src/main/java/ftbsc/lll/exceptions/OrphanElementException.java b/src/main/java/ftbsc/lll/exceptions/OrphanElementException.java new file mode 100644 index 0000000..17c1180 --- /dev/null +++ b/src/main/java/ftbsc/lll/exceptions/OrphanElementException.java @@ -0,0 +1,25 @@ +package ftbsc.lll.exceptions; + +import javax.lang.model.element.Element; +import javax.lang.model.element.QualifiedNameable; + +/** + * Thrown when an annotated element that needs to be paired with + * another does not match with any. + * @since 0.5.0 + */ +public class OrphanElementException extends RuntimeException { + /** + * Constructs an exception for the specified method. + * @param element the orphan element + */ + public OrphanElementException(Element element) { + super( + String.format( + "Could not find a valid target for element %s.%s!", + ((QualifiedNameable) element.getEnclosingElement()).getQualifiedName().toString(), + element.getSimpleName().toString() + ) + ); + } +} |