protected Object[] escape(final Format format, Object... args) {
        // Transformer that escapes HTML,XML,JSON strings
        Transformer<Object, Object> escapingTransformer = new Transformer<Object, Object>() {
            @Override
            public Object transform(Object object) {
                return format.escapeValue(object);
            }
        };
        List<Object> list = Arrays.asList(ArrayUtils.clone(args));
        CollectionUtils.transform(list, escapingTransformer);
        return list.toArray();
    }
protected Object [ ] escape ( final Format format , Object ... args ) { Transformer < Object , Object > escapingTransformer = new Transformer < Object , Object > ( ) { @ Override public Object transform ( Object object ) { return format . escapeValue ( object ) ; } } ; List < Object > list = Arrays . asList ( ArrayUtils . clone ( args ) ) ; CollectionUtils . transform ( list , escapingTransformer ) ; return list . toArray ( ) ; }
Escapes args' string values according to format

@param format the Format used by the PrintStream
@param args the array of args to escape
@return The cloned and escaped array of args