public static View createViewFromXML ( String name , InputStream xml ) throws IOException { try ( InputStream in = new BufferedInputStream ( xml ) ) { View v = ( View ) Jenkins . XSTREAM . fromXML ( in ) ; if ( name != null ) v . name = name ; Jenkins . checkGoodName ( v . name ) ; return v ; } catch ( StreamException | ConversionException | Error e ) { // mostly reflection errors throw new IOException ( "Unable to read" , e ) ; } }
Instantiate View subtype from XML stream .