restygwt/src/main/java/org/fusesource/restygwt/rebind/util/AnnotationCopyUtil.java
private static String encodeAnnotationValue(Object value) {
        // Values of annotation elements must not be "null"
        if (null != value) {
            if (value instanceof String) {
                return readStringValue(value);
            } else if (value instanceof Number) {
                return readNumberValue(value);
            } else if (value.getClass().isArray()) {
                // workaround for ClassCastException: [Ljava.lang.Object; cannot be cast to [I
                // ignore empty arrays, because it becomes Object[]
                if (Array.getLength(value) > 0) {
                    return readArrayValue(value);
                }
                return null;
            } else if (value instanceof Annotation) {
                return getAnnotationAsString((Annotation) value);
            } else if (value instanceof Boolean) {
                return readBooleanValue((Boolean) value);
            } else if (value instanceof Class) {
                return readClassValue((Class) value);
            }
        }

        throw new IllegalArgumentException("Unsupported value for encodeAnnotationValue: " + value);
    }
private static String encodeAnnotationValue(Object value) {
        // Values of annotation elements must not be "null"
        if (null != value) {
            if (value instanceof String) {
                return readStringValue(value);
            } else if (value instanceof Number) {
                return readNumberValue(value);
            } else if (value.getClass().isArray()) {
                // workaround for ClassCastException: [Ljava.lang.Object; cannot be cast to [I
                // ignore empty arrays, because it becomes Object[]
                if (Array.getLength(value) > 0) {
                    return readArrayValue(value);
                }
                return null;
            } else if (value instanceof Annotation) {
                return getAnnotationAsString((Annotation) value);
            } else if (value instanceof Boolean) {
                return readBooleanValue((Boolean) value);
            } else if (value instanceof Class) {
                return readClassValue((Class) value);
            }
        }

        throw new IllegalArgumentException("Unsupported value for encodeAnnotationValue: " + value);
    }
private static String encodeAnnotationValue ( Object value ) { // Values of annotation elements must not be "null" if ( null != value ) { if ( value instanceof String ) { return readStringValue ( value ) ; } else if ( value instanceof Number ) { return readNumberValue ( value ) ; } else if ( value . getClass ( ) . isArray ( ) ) { // workaround for ClassCastException: [Ljava.lang.Object; cannot be cast to [I // ignore empty arrays, because it becomes Object[] if ( Array . getLength ( value ) > 0 ) { return readArrayValue ( value ) ; } return null ; } else if ( value instanceof Annotation ) { return getAnnotationAsString ( ( Annotation ) value ) ; } else if ( value instanceof Boolean ) { return readBooleanValue ( ( Boolean ) value ) ; } else if ( value instanceof Class ) { return readClassValue ( ( Class ) value ) ; } } throw new IllegalArgumentException ( "Unsupported value for encodeAnnotationValue: " + value ) ; }
Returns the string representation of {@code value} or {@code null}, if the element should not be added.

@param value
@return
Returns the string representation of { @code value } or { @code null } if the element should not be added .