/** * Factory method for a default XML configuration instance. Application and domain class * loaders will be initialized to the one used to load the Configuration class. The * configuration instance returned will be a CastorConfiguration with a XMLConfiguration and * a CoreConfiguration instance as parents. The CastorConfiguration holding user specific * properties is the only one that can be modified by put() and remove() methods. * XMLConfiguration and CoreConfiguration are responsble to deliver Castor's default values * if they have not been overwritten by the user. * * @return Configuration instance for Castor XML modul. */ public static Configuration newInstance() { Configuration core = new CoreConfiguration(); Configuration xml = new XMLConfiguration(core); Configuration castor = new CastorConfiguration(xml); return castor; }
/** * Factory method for a XML configuration instance that uses the specified class loaders. The * configuration instance returned will be a CastorConfiguration with a XMLConfiguration and * a CoreConfiguration instance as parents. The CastorConfiguration holding user specific * properties is the only one that can be modified by put() and remove() methods. * XMLConfiguration and CoreConfiguration are responsble to deliver Castor's default values * if they have not been overwritten by the user. * * @param app Classloader to be used for all classes of Castor and its required libraries. * @param domain Classloader to be used for all domain objects. * @return Configuration instance for Castor XML modul. */ public static Configuration newInstance(final ClassLoader app, final ClassLoader domain) { Configuration core = new CoreConfiguration(app, domain); Configuration xml = new XMLConfiguration(core); Configuration castor = new CastorConfiguration(xml); return castor; }