public void setFieldValue(FieldValue fieldValue) {
        if (fieldValue == null) {
            value = null;
            return;
        }

        DataType type = getType().getDataType();
        if (type != null && type.isValueCompatible(fieldValue)) {
            this.value = fieldValue;
        } else {
            String typeName = (type == null) ? "null" : type.getValueClass().getName();
            throw new IllegalArgumentException("Argument is of wrong type, must be of type " + typeName
                                               + ", was " + fieldValue.getClass().getName());
        }
    }
Sets the value of the annotation.

@param fieldValue the value to set
@throws UnsupportedOperationException if the annotation type does not allow this annotation to have values.
document/src/main/java/com/yahoo/document/annotation/Annotation.java