public void setDataType(DataType dataType) {
        if (dataType instanceof AnnotationReferenceDataType) {
            this.dataType = (AnnotationReferenceDataType) dataType;
        } else {
            throw new IllegalArgumentException("Cannot set dataType to " + dataType + ", must be of type AnnotationReferenceDataType.");
        }
    }
WARNING!&nbsp;Only to be used by deserializers when reference is not fully deserialized yet!&nbsp;Sets
an {@link Annotation} that this AnnotationReference shall refer to.

@param reference an Annotation that this AnnotationReference shall refer to.
@throws IllegalArgumentException if the given annotation has a type that is not compatible with this reference
document/src/main/java/com/yahoo/document/annotation/AnnotationReference.java