private void generateStatus ( final Metadata m , final Element e ) { if ( m . getStatus ( ) == null ) { return ; } final Element statusElement = new Element ( "status" , NS ) ; if ( m . getStatus ( ) . getState ( ) != null ) { statusElement . setAttribute ( "state" , m . getStatus ( ) . getState ( ) . name ( ) ) ; } addNotNullAttribute ( statusElement , "reason" , m . getStatus ( ) . getReason ( ) ) ; if ( statusElement . hasAttributes ( ) ) { e . addContent ( statusElement ) ; } }
Generation of status tag .