agave-common/common-api/src/main/java/org/iplantc/service/common/representation/xstream/XstreamRepresentation.java
/**
     * Creates an XStream object based on a media type. By default, it creates a
     * {@link HierarchicalStreamDriver} or a {@link DomDriver}.
     * 
     * @param mediaType
     *            The serialization media type.
     * @return The XStream object.
     * @throws IOException
     */
Creates an XStream object based on a media type. By default, it creates a
HierarchicalStreamDriver or a  DomDriver.

@param mediaType
The serialization media type.
@return The XStream object.
Creates an XStream object based on a media type . By default it creates a HierarchicalStreamDriver or a DomDriver . @param mediaType The serialization media type . @return The XStream object .
protected XStream createXstream(MediaType mediaType) throws IOException {
        XStream result = null;
        try {
            if (MediaType.APPLICATION_JSON.isCompatible(mediaType)) {
                result = new XStream(getJsonDriverClass().newInstance()) {
                	@Override
                    protected MapperWrapper wrapMapper(MapperWrapper next) {
                        return new ApiClassAliasingMapper(next);
                    }
                };
            } else {
                result = new XStream(getXmlDriverClass().newInstance()) {
                	@Override
                    protected MapperWrapper wrapMapper(MapperWrapper next) {
                		return new ApiClassAliasingMapper(next);
                    }
                };
            }
            result.autodetectAnnotations(true);
        } catch (Exception e) {
            IOException ioe = new IOException(
                    "Unable to create the XStream driver: " + e.getMessage(), e);
            throw ioe;
        }
        return result;
    }
protected XStream createXstream ( MediaType mediaType ) throws IOException { XStream result = null ; try { if ( MediaType . APPLICATION_JSON . isCompatible ( mediaType ) ) { result = new XStream ( getJsonDriverClass ( ) . newInstance ( ) ) { @ Override protected MapperWrapper wrapMapper ( MapperWrapper next ) { return new ApiClassAliasingMapper ( next ) ; } } ; } else { result = new XStream ( getXmlDriverClass ( ) . newInstance ( ) ) { @ Override protected MapperWrapper wrapMapper ( MapperWrapper next ) { return new ApiClassAliasingMapper ( next ) ; } } ; } result . autodetectAnnotations ( true ) ; } catch ( Exception e ) { IOException ioe = new IOException ( "Unable to create the XStream driver: " + e . getMessage ( ) , e ) ; throw ioe ; } return result ; }
Creates an XStream object based on a media type.
Creates an XStream object based on a media type .
//result.setMode(XStream.NO_REFERENCES);