FileDocCategorySizeDatePackage
JAXPPlatform.javaAPI DocGlassfish v2 API7914Tue May 22 16:54:50 BST 2007oracle.toplink.essentials.platform.xml.jaxp

JAXPPlatform

public class JAXPPlatform extends Object implements XMLPlatform

Fields Summary
Constructors Summary
public JAXPPlatform()

        super();
    
Methods Summary
public org.w3c.dom.DocumentcreateDocument()

        try {
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            return documentBuilder.newDocument();
        } catch (Exception e) {
            throw XMLPlatformException.xmlPlatformCouldNotCreateDocument(e);
        }
    
public org.w3c.dom.DocumentcreateDocumentWithPublicIdentifier(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier)

        try {
            if (null == publicIdentifier) {
                return createDocumentWithSystemIdentifier(name, systemIdentifier);
            }

            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            DOMImplementation domImpl = documentBuilder.getDOMImplementation();
            DocumentType docType = domImpl.createDocumentType(name, publicIdentifier, systemIdentifier);
            Document document = domImpl.createDocument(null, name, docType);
            return document;
        } catch (Exception e) {
            throw XMLPlatformException.xmlPlatformCouldNotCreateDocument(e);
        }
    
public org.w3c.dom.DocumentcreateDocumentWithSystemIdentifier(java.lang.String name, java.lang.String systemIdentifier)

        try {
            Document document = null;

            if (null == systemIdentifier) {
                document = createDocument();
                Element rootElement = document.createElement(name);
                document.appendChild(rootElement);
                return document;
            }

            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            DOMImplementation domImpl = documentBuilder.getDOMImplementation();
            DocumentType docType = domImpl.createDocumentType(name, null, systemIdentifier);
            document = domImpl.createDocument(null, name, docType);
            return document;
        } catch (Exception e) {
            throw XMLPlatformException.xmlPlatformCouldNotCreateDocument(e);
        }
    
public booleanisWhitespaceNode(org.w3c.dom.Text text)

        String value = text.getNodeValue();
        if (null == value) {
            return false;
        } else {
            return value.trim().equals("");
        }
    
public oracle.toplink.essentials.platform.xml.XMLParsernewXMLParser()

        return new JAXPParser();
    
public oracle.toplink.essentials.platform.xml.XMLTransformernewXMLTransformer()

        return new JAXPTransformer();
    
public java.lang.StringresolveNamespacePrefix(org.w3c.dom.Node contextNode, java.lang.String namespacePrefix)

        if (namespacePrefix.equals(contextNode.getPrefix())) {
            return contextNode.getNamespaceURI();
        }

        if (contextNode.getNodeType() == Node.ELEMENT_NODE) {
            Element contextElement = (Element)contextNode;
            Attr namespaceDeclaration = contextElement.getAttributeNode("xmlns:" + namespacePrefix);
            if (null != namespaceDeclaration) {
                return namespaceDeclaration.getValue();
            }
        }

        Node parentNode = contextNode.getParentNode();
        if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
            return resolveNamespacePrefix((Element)parentNode, namespacePrefix);
        }

        return null;
    
public org.w3c.dom.NodeListselectNodesAdvanced(org.w3c.dom.Node contextNode, java.lang.String xPath, oracle.toplink.essentials.platform.xml.XMLNamespaceResolver xmlNamespaceResolver)
Execute advanced XPath statements that are required for TopLink EIS.

param
contextNode the node relative to which the XPath statement will be executed. xPath the XPath statement namespaceResolver used to resolve namespace prefixes to the corresponding namespace URI
return
the XPath result
throws
XMLPlatformException

        throw oracle.toplink.essentials.exceptions.ValidationException.operationNotSupported("selectNodesAdvanced");
    
public org.w3c.dom.NodeselectSingleNodeAdvanced(org.w3c.dom.Node contextNode, java.lang.String xPath, oracle.toplink.essentials.platform.xml.XMLNamespaceResolver xmlNamespaceResolver)
Execute advanced XPath statements that are required for TopLink EIS.

param
contextNode
param
xPath
param
xmlNamespaceResolver
return
throws
XMLPlatformException

        throw oracle.toplink.essentials.exceptions.ValidationException.operationNotSupported("selectSingleNodeAdvanced");
    
public booleanvalidateDocument(org.w3c.dom.Document document, java.net.URL xmlSchemaURL, org.xml.sax.ErrorHandler errorHandler)

        return true;