/** * Retrieve information describing the abilities of this particular * DOM implementation. Intended to support applications that may be * using DOMs retrieved from several different sources, potentially * with different underlying representations. */ public DOMImplementation getImplementation() { // Currently implemented as a singleton, since it's hardcoded // information anyway. return CoreDOMImplementationImpl.getDOMImplementation(); }
/** NON-DOM: Get the number associated with this document. Used to * order documents in the implementation. */ protected int getNodeNumber() { if (documentNumber==0) { CoreDOMImplementationImpl cd = (CoreDOMImplementationImpl)CoreDOMImplementationImpl.getDOMImplementation(); documentNumber = cd.assignDocumentNumber(); } return documentNumber; }
/** * A method to request a list of DOM implementations that support the * specified features and versions, as specified in . * @param features A string that specifies which features and versions * are required. This is a space separated list in which each feature * is specified by its name optionally followed by a space and a * version number. This is something like: "XML 3.0 Traversal +Events * 2.0" * @return A list of DOM implementations that support the desired * features. */ public DOMImplementationList getDOMImplementationList(String features) { // first check whether the CoreDOMImplementation would do DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation(); final ArrayList implementations = new ArrayList(); if (testImpl(impl, features)) { implementations.add(impl); } impl = DOMImplementationImpl.getDOMImplementation(); if (testImpl(impl, features)) { implementations.add(impl); } return new DOMImplementationListImpl(implementations); }
/** NON-DOM Get the number associated with this doctype. */ protected int getNodeNumber() { // If the doctype has a document owner, get the node number // relative to the owner doc if (getOwnerDocument()!=null) return super.getNodeNumber(); // The doctype is disconnected and not associated with any document. // Assign the doctype a number relative to the implementation. if (doctypeNumber==0) { CoreDOMImplementationImpl cd = (CoreDOMImplementationImpl)CoreDOMImplementationImpl.getDOMImplementation(); doctypeNumber = cd.assignDocTypeNumber(); } return doctypeNumber; }
/** * A method to request a DOM implementation. * @param features A string that specifies which features are required. * This is a space separated list in which each feature is specified * by its name optionally followed by a space and a version number. * This is something like: "XML 1.0 Traversal Events 2.0" * @return An implementation that has the desired features, or * <code>null</code> if this source has none. */ public DOMImplementation getDOMImplementation(String features) { // first check whether the CoreDOMImplementation would do DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation(); if (testImpl(impl, features)) { return impl; } // if not try the DOMImplementation impl = DOMImplementationImpl.getDOMImplementation(); if (testImpl(impl, features)) { return impl; } return null; }