Search in sources :

Example 1 with AnnotationFormatError

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());
}
Also used : AnnotationFormatError(java.lang.annotation.AnnotationFormatError)

Example 2 with AnnotationFormatError

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();
}
Also used : AnnotationFormatError(java.lang.annotation.AnnotationFormatError) Inputs(uk.gov.gchq.gaffer.function.annotation.Inputs)

Example 3 with AnnotationFormatError

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();
}
Also used : Outputs(uk.gov.gchq.gaffer.function.annotation.Outputs) AnnotationFormatError(java.lang.annotation.AnnotationFormatError)

Example 4 with AnnotationFormatError

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();
}
Also used : Outputs(uk.gov.gchq.gaffer.function.annotation.Outputs) AnnotationFormatError(java.lang.annotation.AnnotationFormatError)

Example 5 with AnnotationFormatError

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());
}
Also used : AnnotationFormatError(java.lang.annotation.AnnotationFormatError)

Aggregations

AnnotationFormatError (java.lang.annotation.AnnotationFormatError)8 Outputs (uk.gov.gchq.gaffer.function.annotation.Outputs)2 Signature (org.aspectj.lang.Signature)1 Inputs (uk.gov.gchq.gaffer.function.annotation.Inputs)1