public class XDocumentImpl extends XEntityImpl implements XDocument
| Modifier and Type | Field and Description |
|---|---|
private boolean |
isSuppressNamespaceProcessing
The flag to maintain suppress namespace processing.
|
private java.lang.String |
noNamespaceSchemaLocation
The value of the NONAMESPACE-SCHEMA-LOCATION attribute.
|
private java.util.Map<java.lang.String,java.lang.String> |
schemaLocations
The added schema locations, per namespace URI.
|
private java.lang.String |
schemaPaths
Schema paths locations variable
|
private org.w3c.dom.Document |
xdoc
The real document to assign with handle.
|
IS_INVALID_NODEisValidname, nextSibling, prevSibling, wainstProc, pm| Constructor and Description |
|---|
XDocumentImpl()
Default constructor.
|
XDocumentImpl(org.w3c.dom.Document xdoc)
Associate this X-DOCUMENT resource with an existing document
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
_name()
Get the
name attribute of handle as a string. |
logical |
addSchemaLocation(character namespace,
character location)
Adding new match pair for namespace schema and physical file location.
|
private javax.xml.validation.Schema |
buildSchema()
Build the validation schema using the
noNamespaceSchemaLocation, schemaPaths and
addSchemaLocation(com.goldencode.p2j.util.character, com.goldencode.p2j.util.character) values. |
logical |
createNode(handle hChild,
character name,
character type)
Creating the new node within the current Document object.
|
logical |
createNode(handle hChild,
character name,
java.lang.String type)
Creating the new node within the current Document object.
|
logical |
createNode(handle hChild,
java.lang.String name,
character type)
Creating the new node within the current Document object.
|
logical |
createNode(handle hChild,
java.lang.String name,
java.lang.String type)
Creating the new node within the current Document object.
|
logical |
createNodeNamespace(handle hChild,
character uri,
character name,
character type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
character uri,
character name,
java.lang.String type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
character uri,
java.lang.String name,
character type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
character uri,
java.lang.String name,
java.lang.String type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
java.lang.String uri,
character name,
character type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
java.lang.String uri,
character name,
java.lang.String type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
java.lang.String uri,
java.lang.String name,
character type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
logical |
createNodeNamespace(handle hChild,
java.lang.String uri,
java.lang.String name,
java.lang.String type)
Creating the new node within the current Document object using different
approach based on the name space URI.
|
integer |
getChildNum()
Gets the number of child for the current one.
|
logical |
getDocumentElement(handle hRoot)
Getting the root node for the current document.
|
character |
getEncoding()
Get encoding
|
integer |
getEntityExpansionLimit()
Get the entity expansion limit.
|
org.w3c.dom.Node |
getNode()
Getting the Element backend object for this XEntity.
|
character |
getNonamespaceSchemaLocation()
Gets the value of the XML schema file for elements with no namespaces.
|
handle |
getOwnerDocument()
Getting the Document the current reference belongs to.
|
character |
getPublicId()
This method returns the public ID of the external DTD from which an XML document was
generated.
|
character |
getSchemaLocation()
Determines the list of namespace/location pairs of an XML Schema file to validate
against.
|
character |
getSchemaPath()
A delimiter-separated list of directory paths used to locate the XML Document Type
Definition (DTD) associated with a particular XML document.
|
logical |
getStrictEntityResolution()
Indicates if the strict entity resolution is enabled.
|
logical |
getSuppressNamespaceProcessing()
Indicates if the namespace processing is suppressed or not.
|
character |
getSystemId()
Returns the system ID of the external DTD from which an XML document was generated.
|
logical |
importNode(handle xNodeRef,
handle xSourceNodeRef,
boolean deep)
Creating the new node within the current Document object.
|
logical |
importNode(handle xNodeRef,
handle xSourceNodeRef,
logical deep)
Creating the new node within the current Document object.
|
logical |
initializeDocumentType(character namespaceUri,
character rootNodeName,
character publicId,
character systemId)
Creates a new XML document, initializes the document based on the referenced DTD,
and creates its root node.
|
logical |
initializeDocumentType(character namespaceUri,
java.lang.String rootNodeName,
character publicId,
character systemId)
Creates a new XML document, initializes the document based on the referenced DTD,
and creates its root node.
|
logical |
initializeDocumentType(java.lang.String namespaceUri,
character rootNodeName,
java.lang.String publicId,
java.lang.String systemId)
Creates a new XML document, initializes the document based on the referenced DTD,
and creates its root node.
|
logical |
initializeDocumentType(java.lang.String namespaceUri,
java.lang.String rootNodeName,
java.lang.String publicId,
java.lang.String systemId)
Creates a new XML document, initializes the document based on the referenced DTD,
and creates its root node.
|
private void |
invalidReadWriteModeError(java.lang.String attribute)
Process and display invalid node error.
|
logical |
load(character mode,
java.lang.Object source,
boolean validate)
Loading X-Document form file or memptr sources.
|
logical |
load(character mode,
java.lang.Object source,
logical validate)
Loading X-Document form file or memptr sources.
|
logical |
load(java.lang.String mode,
java.lang.Object source,
boolean validate)
Loading X-Document form file or memptr sources.
|
logical |
load(java.lang.String mode,
java.lang.Object source,
logical validate)
Loading X-Document form file or memptr sources.
|
character |
name()
Get the
name attribute of handle. |
void |
namespacePrefix(character prefix)
Setter for NAMESPACE-PREFIX attribute.
|
private byte[] |
resolveSchemaFile(java.lang.String[] paths,
java.lang.String file)
Resolve the schema file from the FWD client's file-system.
|
protected boolean |
resourceDelete()
Delete the resource.
|
logical |
save(character mode,
java.lang.Object target)
Saving X-Document to file or stream or memptr object.
|
logical |
save(java.lang.String mode,
java.lang.Object target)
Saving X-Document to file or stream or memptr object.
|
void |
setEncoding(character encoding)
Sets the new value of the encoding attribute for the given X-Document object.
|
void |
setEncoding(java.lang.String encoding)
Sets the new value of the encoding attribute for the given X-Document object.
|
void |
setEntityExpansionLimit(int64 limit)
Set the entity expansion limit.
|
void |
setEntityExpansionLimit(long limit)
Set the entity expansion limit.
|
void |
setNonamespaceSchemaLocation(character location)
Setting the new value for the nonamespace-schema-location attribute.
|
void |
setSchemaLocation(character schemaLocation)
Determines the list of namespace/location pairs of an XML Schema file to validate
against.
|
void |
setSchemaPath(character schemaPath)
A delimiter-separated list of directory paths used to locate the XML Document Type
Definition (DTD) associated with a particular XML document.
|
void |
setStrictEntityResolution(boolean strict)
Enable or disable strict entity resolution.
|
void |
setStrictEntityResolution(logical strict)
Enable or disable strict entity resolution.
|
void |
setSuppressNamespaceProcessing(boolean suppress)
Redefines whether the namespace processing is suppressed or not.
|
void |
setSuppressNamespaceProcessing(logical suppress)
Redefines whether the namespace processing is suppressed or not.
|
appendChild, commonDomError, commonDomError, getChild, getChild, getNumChildren, getSubType, getUniqueID, insertBefore, invalidNodeError, isInitialized, isXEntityHandle, isXNodeHandle, isXNodeHandleInitialized, namespacePrefix, namespacePrefix, namespaceURI, namespaceURI, namespaceURI, removeAttribute, removeAttribute, removeChild, replaceChild, setNode, setNodeToHandle, setSubType, setSubType, unsupportedDomErroraddSchemaLocation, addSchemaLocation, addSchemaLocation, hasNextSibling, hasPrevSibling, invalidArgumentAssignError, invalidArgumentError, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, setNonamespaceSchemaLocation, validdelete, firstResource, firstResource, getHead, getNextSibling, getNextSibling, getPrevSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNameConstraints, hasNameReadOnly, hasParent, hasPrivateData, interlink, isChained, lastResource, lastResource, moveInChain, name, name, readOnlyError, readOnlyError, resolveChainType, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData, validateName_instantiatingProcedure, addToPool, doDelete, equals, hashCode, id, id, implicitDeletion, incrementTrigger, instantiatingProcedure, invalidAttribute, processResource, registerResource, resourceType, setInstantiatingProcedure, toString, type, unableToAssignUnknown, unknownclone, finalize, getClass, notify, notifyAll, wait, wait, waitappendChild, getChild, getChild, getNumChildren, insertBefore, removeChild, replaceChildaddSchemaLocation, addSchemaLocation, addSchemaLocation, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, removeAttribute, setNonamespaceSchemaLocationid, id, unknown, validgetUniqueIDnamespacePrefix, namespacePrefix, namespaceURI, namespaceURI, namespaceURIgetSubType, setSubType, setSubTyperesourceTypeallowDeleteprivate org.w3c.dom.Document xdoc
private boolean isSuppressNamespaceProcessing
private java.lang.String schemaPaths
private java.lang.String noNamespaceSchemaLocation
private java.util.Map<java.lang.String,java.lang.String> schemaLocations
public XDocumentImpl(org.w3c.dom.Document xdoc)
xdoc - The real document to assign with handle.public XDocumentImpl()
public org.w3c.dom.Node getNode()
getNode in class XEntityImplprotected boolean resourceDelete()
resourceDelete in class XEntityImpltrue if the resource was deleted.public void namespacePrefix(character prefix)
namespacePrefix in interface NamespaceURInamespacePrefix in class XEntityImplprefix - The new value of the NAMESPACE-PREFIX attribute.public character name()
name attribute of handle.name in interface Nameablename in class XEntityImplpublic java.lang.String _name()
name attribute of handle as a string._name in class XEntityImplpublic logical createNode(handle hChild, java.lang.String name, java.lang.String type)
createNode in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNode(handle hChild, character name, java.lang.String type)
createNode in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNode(handle hChild, java.lang.String name, character type)
createNode in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNode(handle hChild, character name, character type)
createNode in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.name - The name of the node to be created.type - The type of the node to be created.true in case of success false otherwise.public logical createNodeNamespace(handle hChild, java.lang.String uri, java.lang.String name, java.lang.String type)
createNodeNamespace in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.uri - The URI namespace of the node to be created.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNodeNamespace(handle hChild, character uri, java.lang.String name, java.lang.String type)
createNodeNamespace in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.uri - The URI namespace of the node to be created.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNodeNamespace(handle hChild, java.lang.String uri, character name, java.lang.String type)
createNodeNamespace in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.uri - The URI namespace of the node to be created.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNodeNamespace(handle hChild, java.lang.String uri, java.lang.String name, character type)
createNodeNamespace in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.uri - The URI namespace of the node to be created.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNodeNamespace(handle hChild, java.lang.String uri, character name, character type)
createNodeNamespace in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.uri - The URI namespace of the node to be created.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNodeNamespace(handle hChild, character uri, java.lang.String name, character type)
createNodeNamespace in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.uri - The URI namespace of the node to be created.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNodeNamespace(handle hChild, character uri, character name, java.lang.String type)
createNodeNamespace in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.uri - The URI namespace of the node to be created.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical createNodeNamespace(handle hChild, character uri, character name, character type)
createNodeNamespace in interface XDocumenthChild - The valid handle class instance of the child to be created and
returned on method call to use further.uri - The URI namespace of the node to be created.name - The name of the node to be created.type - The type of the node to be created.true in case of success
false otherwise.public logical getDocumentElement(handle hRoot)
getDocumentElement in interface XDocumenthRoot - The valid handle class instance variable to receive the
result.true in case of success
false otherwise.public logical load(java.lang.String mode, java.lang.Object source, logical validate)
load in interface XDocumentmode - Variable indicating the type of source to read. "file" means
reading from file, "memptr" means reading from memory buffer.source - If mode == "file" this is the file name, if "memptr" this is
the memptr object.validate - Flag indicating whether to validate while reading or not.true in case of success
false otherwise.public logical load(java.lang.String mode, java.lang.Object source, boolean validate)
load in interface XDocumentmode - Variable indicating the type of source to read. "file" means
reading from file, "memptr" means reading from memory buffer.source - If mode == "file" this is the file name, if "memptr" this is
the memptr object.validate - Flag indicating whether to validate while reading or not.true in case of success
false otherwise.public logical load(character mode, java.lang.Object source, boolean validate)
load in interface XDocumentmode - Variable indicating the type of source to read. "file" means reading from file and
source contains file name, "memptr" means reading from memory buffer.source - If mode == "file" this is the file name, if "memptr" this is the memptr object.validate - Flag indicating whether to validate while reading or not.true in case of success false otherwise. If validate
is true and xml failed validation return false but the xml document
is loaded anyway.public logical load(character mode, java.lang.Object source, logical validate)
load in interface XDocumentmode - Variable indicating the type of source to read. "file" means reading from file and
source contains file name, "memptr" means reading from memory buffer.source - If mode == "file" this is the file name, if "memptr" this is the memptr object.validate - Flag indicating whether to validate while reading or not. If unknown,
validation will not be done.true in case of success false otherwise. If validate
is true and xml failed validation return false but the xml document
is loaded anyway.public logical save(java.lang.String mode, java.lang.Object target)
save in interface XDocumentmode - Variable indicating the type of target to write. "file" means writing to file,
"stream" means writing to the stream and "memptr" means writing to memory buffer.target - If mode == "file" this is the file name, if "stream" means output stream, if
"memptr" this is the memptr object.true in case of success false otherwise.public logical save(character mode, java.lang.Object target)
save in interface XDocumentmode - Variable indicating the type of target to write. "file" means writing to file,
"stream" means writing to the stream and "memptr" means writing to memory buffer.target - If mode == "file" this is the file name, if "stream" means output stream, if
"memptr" this is the memptr object.true in case of success false otherwise.public logical initializeDocumentType(character namespaceUri, character rootNodeName, character publicId, character systemId)
initializeDocumentType in interface XDocumentnamespaceUri - character expression representing the namespace Uniform Resource Identifier
(URI) you want associated with the root node of the XML document. The
namespace-uri must be unique and persistent.rootNodeName - A character expression representing the name of the root node as defined in the
XML document. If you are using namespaces and you want to associate a prefix
with the namespace, you must qualify this node name with the namespace-uri
and a colon character prefix (for example, namespace-uri:root-node-name).
You must explicitly set the xmlns attribute on the root node.publicId - An optional character expression representing the public ID of the DTD.systemId - A required character expression representing the system ID of the DTD. This
contains the path to the DTD which is either a file system path or an HTTP URL.true in case of success
false otherwise.public logical initializeDocumentType(character namespaceUri, java.lang.String rootNodeName, character publicId, character systemId)
initializeDocumentType in interface XDocumentnamespaceUri - character expression representing the namespace Uniform Resource Identifier
(URI) you want associated with the root node of the XML document. The
namespace-uri must be unique and persistent.rootNodeName - A character expression representing the name of the root node as defined in the
XML document. If you are using namespaces and you want to associate a prefix
with the namespace, you must qualify this node name with the namespace-uri
and a colon character prefix (for example, namespace-uri:root-node-name).
You must explicitly set the xmlns attribute on the root node.publicId - An optional character expression representing the public ID of the DTD.systemId - A required character expression representing the system ID of the DTD. This
contains the path to the DTD which is either a file system path or an HTTP URL.true in case of success
false otherwise.public logical initializeDocumentType(java.lang.String namespaceUri, character rootNodeName, java.lang.String publicId, java.lang.String systemId)
initializeDocumentType in interface XDocumentnamespaceUri - character expression representing the namespace Uniform Resource Identifier
(URI) you want associated with the root node of the XML document. The
namespace-uri must be unique and persistent.rootNodeName - A character expression representing the name of the root node as defined in the
XML document. If you are using namespaces and you want to associate a prefix
with the namespace, you must qualify this node name with the namespace-uri
and a colon character prefix (for example, namespace-uri:root-node-name).
You must explicitly set the xmlns attribute on the root node.publicId - An optional character expression representing the public ID of the DTD.systemId - A required character expression representing the system ID of the DTD. This
contains the path to the DTD which is either a file system path or an HTTP URL.true in case of success
false otherwise.public logical initializeDocumentType(java.lang.String namespaceUri, java.lang.String rootNodeName, java.lang.String publicId, java.lang.String systemId)
initializeDocumentType in interface XDocumentnamespaceUri - character expression representing the namespace Uniform Resource Identifier
(URI) you want associated with the root node of the XML document. The
namespace-uri must be unique and persistent.rootNodeName - A character expression representing the name of the root node as defined in the
XML document. If you are using namespaces and you want to associate a prefix
with the namespace, you must qualify this node name with the namespace-uri
and a colon character prefix (for example, namespace-uri:root-node-name).
You must explicitly set the xmlns attribute on the root node.publicId - An optional character expression representing the public ID of the DTD.systemId - A required character expression representing the system ID of the DTD. This
contains the path to the DTD which is either a file system path or an HTTP URL.true in case of success
false otherwise.public character getPublicId()
getPublicId in interface XDocumentpublic character getSystemId()
getSystemId in interface XDocumentpublic character getSchemaLocation()
getSchemaLocation in interface XmlSchemapublic logical importNode(handle xNodeRef, handle xSourceNodeRef, logical deep)
importNode in interface XDocumentxNodeRef - The valid handle class instance to use for the new XML node.xSourceNodeRef - The valid handle class instance to import from.deep - A logical that if true specifies that the whole sub-tree is to be
copied. The default value is false.true in case of success false otherwise.public logical importNode(handle xNodeRef, handle xSourceNodeRef, boolean deep)
importNode in interface XDocumentxNodeRef - The valid handle class instance to use for the new XML node.xSourceNodeRef - The valid handle class instance to import from.deep - A boolean that if true specifies that the whole sub-tree is to be
copied. The default value is false.true in case of success false otherwise.public void setSchemaLocation(character schemaLocation)
setSchemaLocation in interface XmlSchemaschemaLocation - Determines the list of namespace/location pairs of an XML Schema file to
validate against.public character getEncoding()
getEncoding in interface Encodingpublic character getSchemaPath()
getSchemaPath in interface XmlSchemapublic void setEncoding(java.lang.String encoding)
setEncoding in interface Encodingencoding - The encoding value to be set for the given writer.public void setSchemaPath(character schemaPath)
setSchemaPath in interface XmlSchemaschemaPath - To separate directory paths, use a comma, or a delimiter character that your
operating system recognizes.public void setEncoding(character encoding)
setEncoding in interface Encodingencoding - The encoding value to be set for the given writer.public character getNonamespaceSchemaLocation()
getNonamespaceSchemaLocation in interface XCommongetNonamespaceSchemaLocation in class XCommonImplpublic void setNonamespaceSchemaLocation(character location)
setNonamespaceSchemaLocation in interface XCommonsetNonamespaceSchemaLocation in class XCommonImpllocation - New value of the nonamespace-schema-location attribute to set.public logical addSchemaLocation(character namespace, character location)
addSchemaLocation in interface XCommonaddSchemaLocation in class XCommonImplnamespace - Target namespace of the schema or am empty string or Unknown value.location - Location of the XML schema file.true in case of success false otherwise.public integer getChildNum()
getChildNum in interface XEntitypublic logical getSuppressNamespaceProcessing()
getSuppressNamespaceProcessing in interface XmlSchemapublic void setSuppressNamespaceProcessing(logical suppress)
setSuppressNamespaceProcessing in interface XmlSchemasuppress - The new value the current suppress-namespace-processing attribute.public void setSuppressNamespaceProcessing(boolean suppress)
setSuppressNamespaceProcessing in interface XmlSchemasuppress - The new value the current suppress-namespace-processing attribute.public logical getStrictEntityResolution()
getStrictEntityResolution in interface XmlSchemapublic void setStrictEntityResolution(logical strict)
setStrictEntityResolution in interface XmlSchemastrict - The new value for the attribute.public void setStrictEntityResolution(boolean strict)
setStrictEntityResolution in interface XmlSchemastrict - The new value for the attribute.public integer getEntityExpansionLimit()
getEntityExpansionLimit in interface XmlSchemapublic void setEntityExpansionLimit(int64 limit)
setEntityExpansionLimit in interface XmlSchemalimit - The new value for the attribute.public void setEntityExpansionLimit(long limit)
setEntityExpansionLimit in interface XmlSchemalimit - The new value for the attribute.public handle getOwnerDocument()
getOwnerDocument in interface XEntityprivate void invalidReadWriteModeError(java.lang.String attribute)
attribute - The read-only attribute.private javax.xml.validation.Schema buildSchema()
noNamespaceSchemaLocation, schemaPaths and
addSchemaLocation(com.goldencode.p2j.util.character, com.goldencode.p2j.util.character) values.null if one could ont be built.private byte[] resolveSchemaFile(java.lang.String[] paths,
java.lang.String file)
paths - The paths to check against.file - The file to locate.null if it can not be resolved.