public static Response createTransformResponse ( TransformRule transformRule ) { TransformType transformType = transformRule . getTransformType ( ) ; Response transformResponse ; if ( transformType == TransformType . XSL ) { transformResponse = new XslTransformResponse ( transformRule ) ; } else if ( transformType == TransformType . XML ) { if ( transformRule . getContentType ( ) == null ) { transformRule . setContentType ( ContentType . TEXT_XML . toString ( ) ) ; } transformResponse = new XmlTransformResponse ( transformRule ) ; } else if ( transformType == TransformType . TEXT ) { transformResponse = new TextTransformResponse ( transformRule ) ; } else if ( transformType == TransformType . JSON ) { if ( transformRule . getContentType ( ) == null ) { transformRule . setContentType ( ContentType . TEXT_PLAIN . toString ( ) ) ; } transformResponse = new JsonTransformResponse ( transformRule ) ; } else if ( transformType == TransformType . APON ) { if ( transformRule . getContentType ( ) == null ) { transformRule . setContentType ( ContentType . TEXT_PLAIN . toString ( ) ) ; } transformResponse = new AponTransformResponse ( transformRule ) ; } else { transformResponse = new NoneTransformResponse ( transformRule ) ; } return transformResponse ; }
Creates a new Transform object with specified TransformRule .