- java.lang.Object
-
- org.eclipse.persistence.platform.xml.xdk.XDKPlatform
-
- All Implemented Interfaces:
XMLPlatform
public class XDKPlatform extends Object implements XMLPlatform
Purpose: An implementation of XMLPlatform using Oracle XDK APIs.
-
-
Constructor Summary
Constructors Constructor Description XDKPlatform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
createDocument()
Creates a new document.Document
createDocumentWithPublicIdentifier(String name, String publicIdentifier, 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.Document
createDocumentWithSystemIdentifier(String name, 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, String childName)
This convenience method will iterate through a parent element's children and return the node corresponding to 'nodeName'.boolean
isSecureProcessingDisabled()
boolean
isWhitespaceNode(Text text)
Check to see if the text node represents a whitespace node.void
namespaceQualifyFragment(Element next)
XMLParser
newXMLParser()
Return a concrete implementation of the XML parser abstraction that is compatible with the XML Platform.XMLParser
newXMLParser(Map<String,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.String
resolveNamespacePrefix(Node contextNode, String namespacePrefix)
Return the namespace URI for the specified namespace prefix relative to the context node.NodeList
selectNodesAdvanced(Node contextNode, String xPath, XMLNamespaceResolver xmlNamespaceResolver)
Execute advanced XPath statements that are required for TopLink EIS.Node
selectSingleNodeAdvanced(Node contextNode, String xPath, XMLNamespaceResolver xmlNamespaceResolver)
Execute advanced XPath statements that are required for TopLink EIS.void
setDisableSecureProcessing(boolean disableSecureProcessing)
boolean
validate(Element elem, XMLDescriptor xmlDescriptor, ErrorHandler errorHandler)
Validates a document fragment against a complex type or element in the XML schemaboolean
validateDocument(Document document, URL xmlSchemaURL, ErrorHandler errorHandler)
Validates a document against an XML schema
-
-
-
Method Detail
-
selectSingleNodeAdvanced
public Node selectSingleNodeAdvanced(Node contextNode, String xPath, XMLNamespaceResolver xmlNamespaceResolver) throws XMLPlatformException
Execute advanced XPath statements that are required for TopLink EIS.- Specified by:
selectSingleNodeAdvanced
in interfaceXMLPlatform
- Throws:
XMLPlatformException
-
selectNodesAdvanced
public NodeList selectNodesAdvanced(Node contextNode, String xPath, XMLNamespaceResolver xmlNamespaceResolver) throws XMLPlatformException
Execute advanced XPath statements that are required for TopLink EIS.- Specified by:
selectNodesAdvanced
in interfaceXMLPlatform
- 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 Document createDocument() throws XMLPlatformException
Description copied from interface:XMLPlatform
Creates a new document.- Specified by:
createDocument
in interfaceXMLPlatform
- Returns:
- the new document
- Throws:
XMLPlatformException
-
createDocumentWithPublicIdentifier
public Document createDocumentWithPublicIdentifier(String name, String publicIdentifier, 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 interfaceXMLPlatform
- Parameters:
name
- the name of the root element publicIdentifier the public identifier systemIdentifier the system identifier- Returns:
- the new document
- Throws:
XMLPlatformException
-
createDocumentWithSystemIdentifier
public Document createDocumentWithSystemIdentifier(String name, 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 interfaceXMLPlatform
- Parameters:
name
- the name of the root element systemIdentifier the system identifier- Returns:
- the new document
- Throws:
XMLPlatformException
-
isWhitespaceNode
public boolean isWhitespaceNode(Text text)
Description copied from interface:XMLPlatform
Check to see if the text node represents a whitespace node.- Specified by:
isWhitespaceNode
in interfaceXMLPlatform
- Parameters:
text
- a potential whitespace node- Returns:
- if the text node represents a whitespace node.
-
resolveNamespacePrefix
public String resolveNamespacePrefix(Node contextNode, 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 interfaceXMLPlatform
- 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 interfaceXMLPlatform
- Returns:
- a platform specific XML parser
-
newXMLParser
public XMLParser newXMLParser(Map<String,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 interfaceXMLPlatform
- 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 interfaceXMLPlatform
- Returns:
- a platform specific XML transformer
-
validateDocument
public boolean validateDocument(Document document, URL xmlSchemaURL, ErrorHandler errorHandler) throws XMLPlatformException
Validates a document against an XML schema- Specified by:
validateDocument
in interfaceXMLPlatform
- Parameters:
document
- - the document to be validatedxmlSchemaURL
- - the schema URLerrorHandler
- - the error handler- Returns:
- true if the document fragment is valid, false otherwise
- Throws:
XMLPlatformException
-
validate
public boolean validate(Element elem, XMLDescriptor xmlDescriptor, ErrorHandler errorHandler) throws XMLPlatformException
Validates a document fragment against a complex type or element in the XML schema- Specified by:
validate
in interfaceXMLPlatform
- Parameters:
elem
- - the document which contains the document fragment to be validatedxmlDescriptor
- - the path to the complex type or element to be validated against in the schemaerrorHandler
- - the error handler- Returns:
- true if the document fragment is valid, false otherwise
- Throws:
XMLPlatformException
-
findChildNode
protected oracle.xml.parser.schema.XSDNode findChildNode(oracle.xml.parser.schema.XSDElement parent, String childName)
This convenience method will iterate through a parent element's children and return the node corresponding to 'nodeName'.- Parameters:
parent
- - the parent elementchildName
- - the node name to be located- Returns:
- the child node with name matching 'childName', null if not found
-
namespaceQualifyFragment
public void namespaceQualifyFragment(Element next)
- Specified by:
namespaceQualifyFragment
in interfaceXMLPlatform
- Parameters:
next
- Element to qualify
-
setDisableSecureProcessing
public void setDisableSecureProcessing(boolean disableSecureProcessing)
- Specified by:
setDisableSecureProcessing
in interfaceXMLPlatform
-
isSecureProcessingDisabled
public boolean isSecureProcessingDisabled()
- Specified by:
isSecureProcessingDisabled
in interfaceXMLPlatform
-
-