Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.platform.xml.xdk
Class XDKPlatform

java.lang.Object
  extended by org.eclipse.persistence.platform.xml.xdk.XDKPlatform

All Implemented Interfaces:
XMLPlatform

public class XDKPlatform
extends java.lang.Object
implements XMLPlatform

Purpose: An implementation of XMLPlatform using Oracle XDK APIs.


Field Summary
private  java.lang.reflect.Method buildSchemaMethod
           

 

Constructor Summary
XDKPlatform()
           

 

Method Summary
 org.w3c.dom.Document createDocument()
          Creates a new document.
 org.w3c.dom.Document createDocumentWithPublicIdentifier(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier)
          Creates a new document with the specified public and system identifiers in the DOCTYPE, and adds a root element with the specified name.
 org.w3c.dom.Document createDocumentWithSystemIdentifier(java.lang.String name, java.lang.String systemIdentifier)
          Creates a new document with the specified system identifier in the DOCTYPE, and adds a root element with the specified name.
protected  oracle.xml.parser.schema.XSDNode findChildNode(oracle.xml.parser.schema.XSDElement parent, java.lang.String childName)
          This convenience method will iterate through a parent element's children and return the node corresponding to 'nodeName'.
private  oracle.xml.parser.schema.XSDNode getNodeFromSchemaReference(oracle.xml.parser.schema.XMLSchema xmlSchema, XMLSchemaReference schemaRef, NamespaceResolver nsResolver)
          This convenience method will parse a schema reference and return the node to be validated against.
private  void handleErrors(oracle.xml.parser.v2.XMLError xmlErr, org.xml.sax.ErrorHandler errorHandler)
           
 boolean isWhitespaceNode(org.w3c.dom.Text text)
          Check to see if the text node represents a whitespace node.
 void namespaceQualifyFragment(org.w3c.dom.Element next)
           
private  void namespaceQualifyFragment(org.w3c.dom.Element next, java.util.List<java.lang.String> declaredPrefixes)
           
 XMLParser newXMLParser()
          Return a concrete implementation of the XML parser abstraction that is compatible with the XML Platform.
 XMLParser newXMLParser(java.util.Map<java.lang.String,java.lang.Boolean> parserFeatures)
          Return a concrete implementation of the XML parser abstraction that is compatible with the XML Platform, based on these parser features.
 XMLTransformer newXMLTransformer()
          Return a concrete implementation of the XML transformer abstraction that is compatible with the XML Platform.
 java.lang.String resolveNamespacePrefix(org.w3c.dom.Node contextNode, java.lang.String namespacePrefix)
          Return the namespace URI for the specified namespace prefix relative to the context node.
 org.w3c.dom.NodeList selectNodesAdvanced(org.w3c.dom.Node contextNode, java.lang.String xPath, XMLNamespaceResolver xmlNamespaceResolver)
          Execute advanced XPath statements that are required for TopLink EIS.
 org.w3c.dom.Node selectSingleNodeAdvanced(org.w3c.dom.Node contextNode, java.lang.String xPath, XMLNamespaceResolver xmlNamespaceResolver)
          Execute advanced XPath statements that are required for TopLink EIS.
 boolean validate(org.w3c.dom.Element elem, XMLDescriptor xmlDescriptor, org.xml.sax.ErrorHandler errorHandler)
          Validates a document fragment against a complex type or element in the XML schema
 boolean validateDocument(org.w3c.dom.Document document, java.net.URL xmlSchemaURL, org.xml.sax.ErrorHandler errorHandler)
          Validates a document against an XML schema

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

buildSchemaMethod

private java.lang.reflect.Method buildSchemaMethod

Constructor Detail

XDKPlatform

public XDKPlatform()

Method Detail

selectSingleNodeAdvanced

public org.w3c.dom.Node selectSingleNodeAdvanced(org.w3c.dom.Node contextNode,
                                                 java.lang.String xPath,
                                                 XMLNamespaceResolver xmlNamespaceResolver)
                                          throws XMLPlatformException
Execute advanced XPath statements that are required for TopLink EIS.
Specified by:
selectSingleNodeAdvanced in interface XMLPlatform
Parameters:
contextNode -
xPath -
xmlNamespaceResolver -
Returns:
Throws:
XMLPlatformException

selectNodesAdvanced

public org.w3c.dom.NodeList selectNodesAdvanced(org.w3c.dom.Node contextNode,
                                                java.lang.String xPath,
                                                XMLNamespaceResolver xmlNamespaceResolver)
                                         throws XMLPlatformException
Execute advanced XPath statements that are required for TopLink EIS.
Specified by:
selectNodesAdvanced in interface XMLPlatform
Parameters:
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
Returns:
the XPath result
Throws:
XMLPlatformException

createDocument

public org.w3c.dom.Document createDocument()
                                    throws XMLPlatformException
Description copied from interface: XMLPlatform
Creates a new document.
Specified by:
createDocument in interface XMLPlatform
Returns:
the new document
Throws:
XMLPlatformException

createDocumentWithPublicIdentifier

public org.w3c.dom.Document createDocumentWithPublicIdentifier(java.lang.String name,
                                                               java.lang.String publicIdentifier,
                                                               java.lang.String systemIdentifier)
                                                        throws XMLPlatformException
Description copied from interface: XMLPlatform
Creates a new document with the specified public and system identifiers in the DOCTYPE, and adds a root element with the specified name.
Specified by:
createDocumentWithPublicIdentifier in interface XMLPlatform
Parameters:
name - the name of the root element publicIdentifier the public identifier systemIdentifier the system identifier
Returns:
the new document
Throws:
XMLPlatformException

createDocumentWithSystemIdentifier

public org.w3c.dom.Document createDocumentWithSystemIdentifier(java.lang.String name,
                                                               java.lang.String systemIdentifier)
                                                        throws XMLPlatformException
Description copied from interface: XMLPlatform
Creates a new document with the specified system identifier in the DOCTYPE, and adds a root element with the specified name.
Specified by:
createDocumentWithSystemIdentifier in interface XMLPlatform
Parameters:
name - the name of the root element systemIdentifier the system identifier
Returns:
the new document
Throws:
XMLPlatformException

isWhitespaceNode

public boolean isWhitespaceNode(org.w3c.dom.Text text)
Description copied from interface: XMLPlatform
Check to see if the text node represents a whitespace node.
Specified by:
isWhitespaceNode in interface XMLPlatform
Parameters:
text - a potential whitespace node
Returns:
if the text node represents a whitespace node.

resolveNamespacePrefix

public java.lang.String resolveNamespacePrefix(org.w3c.dom.Node contextNode,
                                               java.lang.String namespacePrefix)
                                        throws XMLPlatformException
Description copied from interface: XMLPlatform
Return the namespace URI for the specified namespace prefix relative to the context node.
Specified by:
resolveNamespacePrefix in interface XMLPlatform
Parameters:
contextNode - the node to be looking for the namespace URI namespacePrefix the namespace prefix
Returns:
the namespace URI for the specified prefix
Throws:
XMLPlatformException

newXMLParser

public XMLParser newXMLParser()
Description copied from interface: XMLPlatform
Return a concrete implementation of the XML parser abstraction that is compatible with the XML Platform.
Specified by:
newXMLParser in interface XMLPlatform
Returns:
a platform specific XML parser

newXMLParser

public XMLParser newXMLParser(java.util.Map<java.lang.String,java.lang.Boolean> parserFeatures)
Description copied from interface: XMLPlatform
Return a concrete implementation of the XML parser abstraction that is compatible with the XML Platform, based on these parser features.
Specified by:
newXMLParser in interface XMLPlatform
Returns:
a platform specific XML parser

newXMLTransformer

public XMLTransformer newXMLTransformer()
Description copied from interface: XMLPlatform
Return a concrete implementation of the XML transformer abstraction that is compatible with the XML Platform.
Specified by:
newXMLTransformer in interface XMLPlatform
Returns:
a platform specific XML transformer

validateDocument

public boolean validateDocument(org.w3c.dom.Document document,
                                java.net.URL xmlSchemaURL,
                                org.xml.sax.ErrorHandler errorHandler)
                         throws XMLPlatformException
Validates a document against an XML schema
Specified by:
validateDocument in interface XMLPlatform
Parameters:
document - - the document to be validated
xmlSchemaURL - - the schema URL
errorHandler - - the error handler
Returns:
true if the document fragment is valid, false otherwise
Throws:
XMLPlatformException

validate

public boolean validate(org.w3c.dom.Element elem,
                        XMLDescriptor xmlDescriptor,
                        org.xml.sax.ErrorHandler errorHandler)
                 throws XMLPlatformException
Validates a document fragment against a complex type or element in the XML schema
Specified by:
validate in interface XMLPlatform
Parameters:
document - - the document which contains the document fragment to be validated
schemaReference - - the path to the complex type or element to be validated against in the schema
handler - - the error handler
Returns:
true if the document fragment is valid, false otherwise
Throws:
XMLPlatformException

handleErrors

private void handleErrors(oracle.xml.parser.v2.XMLError xmlErr,
                          org.xml.sax.ErrorHandler errorHandler)

getNodeFromSchemaReference

private oracle.xml.parser.schema.XSDNode getNodeFromSchemaReference(oracle.xml.parser.schema.XMLSchema xmlSchema,
                                                                    XMLSchemaReference schemaRef,
                                                                    NamespaceResolver nsResolver)
This convenience method will parse a schema reference and return the node to be validated against.
Parameters:
xmlSchema - - the schema to be used for validation
schemaRef - - the schema reference object
Returns:
the node to be validated against, null if not found

findChildNode

protected oracle.xml.parser.schema.XSDNode findChildNode(oracle.xml.parser.schema.XSDElement parent,
                                                         java.lang.String childName)
This convenience method will iterate through a parent element's children and return the node corresponding to 'nodeName'.
Parameters:
parent - - the parent element
childName - - the node name to be located
Returns:
the child node with name matching 'childName', null if not found

namespaceQualifyFragment

public void namespaceQualifyFragment(org.w3c.dom.Element next)
Specified by:
namespaceQualifyFragment in interface XMLPlatform
Parameters:
next - Element to qualify

namespaceQualifyFragment

private void namespaceQualifyFragment(org.w3c.dom.Element next,
                                      java.util.List<java.lang.String> declaredPrefixes)

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.