private void parseFaultDetail ( BeanDefinitionBuilder builder , Element faultElement ) { List < Element > faultDetailElements = DomUtils . getChildElementsByTagName ( faultElement , "fault-detail" ) ; List < String > faultDetails = new ArrayList < String > ( ) ; List < String > faultDetailResourcePaths = new ArrayList < String > ( ) ; for ( Element faultDetailElement : faultDetailElements ) { if ( faultDetailElement . hasAttribute ( "file" ) ) { if ( StringUtils . hasText ( DomUtils . getTextValue ( faultDetailElement ) . trim ( ) ) ) { throw new BeanCreationException ( "You tried to set fault-detail by file resource attribute and inline text value at the same time! " + "Please choose one of them." ) ; } String charset = faultDetailElement . getAttribute ( "charset" ) ; String filePath = faultDetailElement . getAttribute ( "file" ) ; faultDetailResourcePaths . add ( filePath + ( StringUtils . hasText ( charset ) ? FileUtils . FILE_PATH_CHARSET_PARAMETER + charset : "" ) ) ; } else { String faultDetailData = DomUtils . getTextValue ( faultDetailElement ) . trim ( ) ; if ( StringUtils . hasText ( faultDetailData ) ) { faultDetails . add ( faultDetailData ) ; } else { throw new BeanCreationException ( "Not content for fault-detail is set! Either use file attribute or inline text value for fault-detail element." ) ; } } } builder . addPropertyValue ( "faultDetails" , faultDetails ) ; builder . addPropertyValue ( "faultDetailResourcePaths" , faultDetailResourcePaths ) ; }
Parses the fault detail element .