use of java.lang.annotation.AnnotationFormatError in project robovm by robovm.
the class AnnotationFormatErrorTest method test_constructorLjava_lang_StringLjava_lang_Throwable.
/**
* @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(String,Throwable)
*/
@SuppressWarnings("nls")
public void test_constructorLjava_lang_StringLjava_lang_Throwable() {
IllegalArgumentException iae = new IllegalArgumentException();
AnnotationFormatError e = new AnnotationFormatError("some message", iae);
assertEquals("some message", e.getMessage());
assertSame(iae, e.getCause());
}
use of java.lang.annotation.AnnotationFormatError in project Gaffer by gchq.
the class ConsumerFunction method processInputAnnotation.
/**
* Retrieves the input record structure from the {@link uk.gov.gchq.gaffer.function.annotation.Inputs} annotation.
*/
private void processInputAnnotation() {
final Inputs annotation = getClass().getAnnotation(Inputs.class);
if (null == annotation) {
throw new AnnotationFormatError("All consumer function classes must have inputs defined using the 'Inputs' annotation on the class." + " Class: " + getClass());
}
inputs = annotation.value();
}
use of java.lang.annotation.AnnotationFormatError in project Gaffer by gchq.
the class ConsumerProducerFunction method processOutputAnnotation.
/**
* Retrieves the input record structure from the {@link uk.gov.gchq.gaffer.function.annotation.Inputs} annotation.
*/
private void processOutputAnnotation() {
final Outputs annotation = getClass().getAnnotation(Outputs.class);
if (null == annotation) {
throw new AnnotationFormatError("All consumer producer function classes must have outputs defined using the 'Outputs' annotation on the class." + " Class: " + getClass());
}
outputs = annotation.value();
}
use of java.lang.annotation.AnnotationFormatError in project Gaffer by gchq.
the class ProducerFunction method processOutputAnnotation.
/**
* Retrieves the input record structure from the {@link uk.gov.gchq.gaffer.function.annotation.Inputs} annotation.
*/
private void processOutputAnnotation() {
final Outputs annotation = getClass().getAnnotation(Outputs.class);
if (null == annotation || null == annotation.value()) {
throw new AnnotationFormatError("All producer function classes must have outputs defined using the 'Outputs' annotation on the class.");
}
outputs = annotation.value();
}
use of java.lang.annotation.AnnotationFormatError in project robovm by robovm.
the class AnnotationFormatErrorTest method test_constructorLjava_lang_Throwable.
/**
* @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(Throwable)
*/
public void test_constructorLjava_lang_Throwable() {
IllegalArgumentException iae = new IllegalArgumentException();
AnnotationFormatError e = new AnnotationFormatError(iae);
assertSame(iae, e.getCause());
}
Aggregations