List of usage examples for java.beans.beancontext BeanContextSupport instantiateChild
public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException
The instantiateChild method is a convenience hook in BeanContext to simplify the task of instantiating a Bean, nested, into a BeanContext .
From source file:Example3.java
public static void main(String[] args) { BeanContextSupport context = new BeanContextSupport(); System.out.println("Number of children nested into the context: " + context.size()); BeanContextChildSupport child = null; try {/*from w ww . j a v a 2s . c o m*/ child = (BeanContextChildSupport) context .instantiateChild("java.beans.beancontext.BeanContextChildSupport"); } catch (IOException e) { System.out.println("IOException occurred: " + e.getMessage()); } catch (ClassNotFoundException e) { System.out.println("Class not found: " + e.getMessage()); } System.out.println("Number of children nested into the context: " + context.size()); }