public List<ReconfigBeanDefinitionHolder> load(Resource resource) {
    List<ReconfigBeanDefinitionHolder> holders = new ArrayList<ReconfigBeanDefinitionHolder>();
    try {
      InputStream inputStream = resource.getInputStream();
      try {
        InputSource inputSource = new InputSource(inputStream);
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder = factory.newDocumentBuilder();
        Document doc = docBuilder.parse(inputSource);
        Element root = doc.getDocumentElement();
        NodeList nl = root.getChildNodes();
        BeanDefinitionParser parser = new BeanDefinitionParser();
        for (int i = 0; i < nl.getLength(); i++) {
          Node node = nl.item(i);
          if (node instanceof Element) {
            Element ele = (Element) node;
            ReconfigBeanDefinitionHolder holder = parser.parseBeanDefinitionElement(ele);
            holders.add(holder);
          }
        }
      } finally {
        if (null != inputStream) {
          inputStream.close();
        }
      }
    } catch (Exception ex) {
      throw new RuntimeException("IOException parsing XML document from " + resource.getDescription(), ex);
    }
    return holders;
  }
public List < ReconfigBeanDefinitionHolder > load ( Resource resource ) { List < ReconfigBeanDefinitionHolder > holders = new ArrayList < ReconfigBeanDefinitionHolder > ( ) ; try { InputStream inputStream = resource . getInputStream ( ) ; try { InputSource inputSource = new InputSource ( inputStream ) ; DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder docBuilder = factory . newDocumentBuilder ( ) ; Document doc = docBuilder . parse ( inputSource ) ; Element root = doc . getDocumentElement ( ) ; NodeList nl = root . getChildNodes ( ) ; BeanDefinitionParser parser = new BeanDefinitionParser ( ) ; for ( int i = 0 ; i < nl . getLength ( ) ; i ++ ) { Node node = nl . item ( i ) ; if ( node instanceof Element ) { Element ele = ( Element ) node ; ReconfigBeanDefinitionHolder holder = parser . parseBeanDefinitionElement ( ele ) ; holders . add ( holder ) ; } } } finally { if ( null != inputStream ) { inputStream . close ( ) ; } } } catch ( Exception ex ) { throw new RuntimeException ( "IOException parsing XML document from " + resource . getDescription ( ) , ex ) ; } return holders ; }
<p>
load.
</p>

@param resource a {@link org.springframework.core.io.Resource} object.
@return a {@link java.util.List} object.