/** * Provides a default * {@link org.mozilla.javascript.xml.XMLLib.Factory XMLLib.Factory} * to be used by the <code>Context</code> instances produced by this * factory. See {@link Context#getE4xImplementationFactory} for details. * * May return null, in which case E4X functionality is not supported in * Rhino. * * The default implementation now prefers the DOM3 E4X implementation. */ protected org.mozilla.javascript.xml.XMLLib.Factory getE4xImplementationFactory() { // Must provide default implementation, rather than abstract method, // so that past implementors of ContextFactory do not fail at runtime // upon invocation of this method. // Note that the default implementation returns null if we // neither have XMLBeans nor a DOM3 implementation present. if (isDom3Present()) { return org.mozilla.javascript.xml.XMLLib.Factory.create( "org.mozilla.javascript.xmlimpl.XMLLibImpl" ); } else { return null; } }
/** Provides a default {@link org.mozilla.javascript.xml.XMLLib.Factory XMLLib.Factory} to be used by the <code>Context</code> instances produced by this factory. See {@link Context#getE4xImplementationFactory} for details. */ protected org.mozilla.javascript.xml.XMLLib.Factory getE4xImplementationFactory() { // Must provide default implementation, rather than abstract method, // so that past implementors of ContextFactory do not fail at runtime // upon invocation of this method. // Note that the default implementation "illegally" returns null if we // neither have XMLBeans nor a DOM3 implementation present. // // TODO More thinking about what to do in the failure scenario // For now, if XMLBeans is in the classpath, it will be the default. if (Kit.classOrNull("org.apache.xmlbeans.XmlCursor") != null) { return org.mozilla.javascript.xml.XMLLib.Factory.create( "org.mozilla.javascript.xml.impl.xmlbeans.XMLLibImpl" ); } else if (isDom3Present()) { return org.mozilla.javascript.xml.XMLLib.Factory.create( "org.mozilla.javascript.xmlimpl.XMLLibImpl" ); } else { // Uh-oh -- results if FEATURE_E4X is true are unknown. return null; } }
if (isDom3Present()) { return org.mozilla.javascript.xml.XMLLib.Factory.create( "org.mozilla.javascript.xmlimpl.XMLLibImpl"
if (isDom3Present()) { return org.mozilla.javascript.xml.XMLLib.Factory.create( "org.mozilla.javascript.xmlimpl.XMLLibImpl"
if (isDom3Present()) { return org.mozilla.javascript.xml.XMLLib.Factory.create( "org.mozilla.javascript.xmlimpl.XMLLibImpl"
if (isDom3Present()) { return org.mozilla.javascript.xml.XMLLib.Factory.create( "org.mozilla.javascript.xmlimpl.XMLLibImpl"