|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cip4.jdflib.core.XMLDoc
public class XMLDoc
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
log
|
protected DocumentXMLImpl |
m_doc
|
protected static String |
sm_strENCODING
Encoding. |
| Constructor Summary | |
|---|---|
XMLDoc()
constructor |
|
XMLDoc(Document document)
constructor |
|
XMLDoc(DocumentXMLImpl document)
constructor |
|
XMLDoc(String strDocType)
Deprecated. use XMLDoc(String strDocType, String namespaceURI) |
|
XMLDoc(String strDocType,
String namespaceURI)
constructor |
|
XMLDoc(XMLDoc other)
constructor |
|
| Method Summary | |
|---|---|
Node |
appendChild(Node newChild)
append a new child node to 'this' |
XMLDoc |
clone()
clone the document, completely severing all connections to the original document |
Node |
cloneNode(boolean deep)
get a copy of 'this' |
void |
copyMeta(XMLDoc dMine)
copy metadata from other document |
Attr |
createAttribute(String name)
createAttribute in namespace JDFCoreConstants.NONAMESPACE (DOM Level 2) |
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName)
create an attribute withe the given name in the given namespace |
CDATASection |
createCDATASection(String data)
create a CDATA section, which has this document as ownerDoc |
Comment |
createComment(String data)
createComment |
DocumentFragment |
createDocumentFragment()
createDocumentFragment |
DocumentType |
createDocumentType(String qualifiedName,
String publicID,
String systemID)
createDocumentType |
Element |
createElement(String elementName)
createElement create a JDFElement that floats in nirvana. |
org.apache.xerces.dom.ElementDefinitionImpl |
createElementDefinition(String name)
creates an element definition. |
Element |
createElementNS(String namespaceURI,
String qualifiedName)
create a Element that floats in nirvana, this must be appended to a node with appendChild |
Entity |
createEntity(String name)
create an entity |
EntityReference |
createEntityReference(String name)
creates an EntityReference |
Event |
createEvent(String type)
create an Event object |
org.w3c.dom.traversal.NodeIterator |
createNodeIterator(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean entityReferenceExpansion)
createNodeIterator |
org.w3c.dom.traversal.NodeIterator |
createNodeIterator(Node root,
short whatToShow,
org.w3c.dom.traversal.NodeFilter filter)
create a node iterator |
Notation |
createNotation(String name)
creates a Notation having this Document as its OwnerDoc |
ProcessingInstruction |
createProcessingInstruction(String target,
String data)
creates a ProcessingInstruction having this Document as ownerDoc |
org.w3c.dom.ranges.Range |
createRange()
createRange |
protected XMLDoc |
createRoot(Document document)
|
Text |
createTextNode(String data)
createTextNode |
org.w3c.dom.traversal.TreeWalker |
createTreeWalker(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean entityReferenceExpansion)
creates a TreeWalker |
org.w3c.dom.traversal.TreeWalker |
createTreeWalker(Node root,
short whatToShow,
org.w3c.dom.traversal.NodeFilter filter)
creates a TreeWalker |
boolean |
equals(Object o)
|
protected boolean |
flush()
Method Flush clean the m_doc and restart from scratch. |
NamedNodeMap |
getAttributes()
get the attributes associated with this node |
javax.mail.BodyPart |
getBodyPart()
get the Javax.Mail.BodyPart |
NodeList |
getChildNodes()
get the child nodes of this node |
long |
getDocMemoryUsed()
rough guestimate of the memory used by this if called after parsing |
DocumentType |
getDoctype()
getDoctype |
Element |
getDocumentElement()
getDocumentElement |
Element |
getElementById(String elementId)
get element with ID = elementId similar to Docoment.getElementByID but works with non schema parsed documents |
NodeList |
getElementsByTagName(String tagname)
return a NodeList of all elements having the specified tagname |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String myLocalName)
get a NodeList of all elements with a given name and namespace URI |
boolean |
getErrorChecking()
does the DOM implementation perform error checking upon operations? |
Node |
getFirstChild()
get the first child node of 'this' |
Element |
getIdentifier(String idName)
gets the element with the registered name = "idName" |
Enumeration<?> |
getIdentifiers()
gets the registered identifiers |
protected DocumentXMLImpl |
getImpl()
|
DOMImplementation |
getImplementation()
getImplementation |
Node |
getLastChild()
get the last child node of 'this' |
String |
getLocalName()
get the the local part of the qualified name of 'this' |
DocumentXMLImpl |
getMemberDocument()
getMemberDocument |
javax.mail.Multipart |
getMultiPart()
get the Javax.Mail.Multipart |
Node |
getNextSibling()
get the next sibling of 'this' |
String |
getNodeName()
gets the node name |
short |
getNodeType()
get node type |
String |
getNodeValue()
gets the node value |
String |
getOriginalFileName()
|
Node |
getParentNode()
get the parent node of 'this' node |
String |
getPrefix()
get the namespace prefix of 'this' node |
Node |
getPreviousSibling()
get the previous sibling of 'this' |
KElement |
getRoot()
get the root of the dom tree |
String |
getSchemaLocation(String nsURI)
|
File |
getSchemaLocationFile(String nsURI)
|
protected XMLParser |
getXMLParser()
|
ZipReader |
getZipReader()
get the ZipReader |
boolean |
hasAttributes()
check if 'this' has attributes |
boolean |
hasChildNodes()
test if 'this' has any children |
int |
hashCode()
|
Node |
importNode(Node importedNode,
boolean deep)
copy a node from another document in this document |
Node |
insertBefore(Node newChild,
Node refChild)
insert a new node before a given node |
boolean |
isNull()
check whether the underlying document is null |
boolean |
isSupported(String feature,
String version)
test whether a specific DOMImplelementation feature is supported by 'this' |
void |
normalize()
normalize |
static XMLDoc |
parseFile(File file)
parse an XML file |
static XMLDoc |
parseFile(String fileName)
parse an XML file |
static XMLDoc |
parseStream(InputStream is)
parse a JDF input stream |
static XMLDoc |
parseURL(String url,
javax.mail.BodyPart bp)
parse a given url |
void |
putIdentifier(String idName,
Element element)
Registers an identifier name with a specified element node |
Node |
removeChild(Node oldChild)
remove a child from 'this' |
void |
removeIdentifier(String idName)
remove element with identifier "idName" |
Node |
replaceChild(Node newChild,
Node oldChild)
replace a child node with a new one |
void |
setBodyPart(javax.mail.BodyPart bodyPart)
set the Javax.Mail.BodyPart |
void |
setErrorChecking(boolean check)
sets whether the DOM implementation performs error checking upon operations |
protected void |
setMemberDoc(DocumentXMLImpl myDoc)
|
void |
setNodeValue(String nodeValue)
set the node value |
void |
setNSMap(XMLDoc other)
set the namespace map from another document |
void |
setOriginalFileName(String originalFileName)
|
void |
setPrefix(String prefix)
set the namespace prefix of 'this' node |
KElement |
setRoot(String strDocType,
String namespaceURI)
initialize a new root of strDocType in the document called by constructor XMLDoc(String strDocType) |
void |
setSchemaLocation(String nsURI,
File _schemaLocation)
set xs:schemalocation to |
void |
setValidationResult(XMLDoc validationResult)
|
void |
setXSLTURL(String url)
sets the processing instruction for an xslt stylesheet |
void |
setZipReader(ZipReader zip)
set the ZipReader |
String |
toString()
toString |
String |
toXML()
toXML |
boolean |
write2File(File file,
int indent,
boolean bPreserveSpace)
write2File - write to a file; Create if it doesn't exist |
boolean |
write2File(String oFilePath,
int indent)
Deprecated. 060419 use write2File(oFilePath, indent, true); |
boolean |
write2File(String oFilePath,
int indent,
boolean bPreserveSpace)
write2File - write to a file; Create if it doesn't exist always assume utf-8 encoding |
UrlPart |
write2HttpURL(URL url,
String strContentType,
UrlUtil.HTTPDetails det)
|
HttpURLConnection |
write2HTTPURL(URL url,
String strContentType,
UrlUtil.HTTPDetails det)
|
void |
write2Stream(OutputStream outStream,
int indent)
Deprecated. use write2Stream(outStream, indent, true); |
void |
write2Stream(OutputStream outStream,
int indent,
boolean bPreserveSpace)
write this to a stream |
static void |
write2StreamStatic(Element elem,
OutputStream outStream,
int indent)
Deprecated. 060306 |
static void |
write2StreamStatic(Element elem,
OutputStream outStream,
int indent,
boolean bPreserveSpace)
Deprecated. 060306 |
String |
write2String(int indent)
write2String - write to a string; |
XMLDoc |
write2URL(String strURL,
String strContentType)
This method sends the contents of this XMLDoc to the URL strURL and receives the response in the returned XMLDoc. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected DocumentXMLImpl m_doc
protected final org.apache.commons.logging.Log log
protected static final String sm_strENCODING
| Constructor Detail |
|---|
public XMLDoc()
public XMLDoc(Document document)
document - public XMLDoc(DocumentXMLImpl document)
document - public XMLDoc(XMLDoc other)
other - @Deprecated public XMLDoc(String strDocType)
strDocType - ElementName.JDF, ElementName.JMF, "Config" ...
public XMLDoc(String strDocType,
String namespaceURI)
strDocType - ElementName.JDF, ElementName.JMF, "Config" ...namespaceURI - namespace to be used by the new XMLDoc| Method Detail |
|---|
public boolean equals(Object o)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()protected XMLDoc createRoot(Document document)
protected DocumentXMLImpl getImpl()
public KElement setRoot(String strDocType,
String namespaceURI)
strDocType - qualified tag name of the doc root to create if still emptynamespaceURI - namespace URI of the doc root
public DocumentXMLImpl getMemberDocument()
protected boolean flush()
public KElement getRoot()
public String write2String(int indent)
indent - the indentation of the xml
@Deprecated
public boolean write2File(String oFilePath,
int indent)
oFilePath - indent -
public boolean write2File(String oFilePath,
int indent,
boolean bPreserveSpace)
oFilePath - where to write the fileindent - indentationbPreserveSpace - if true, preserve whitespace
public boolean write2File(File file,
int indent,
boolean bPreserveSpace)
file - the file to write toindent - indentationbPreserveSpace - if true, preserve whitespace
@Deprecated
public void write2Stream(OutputStream outStream,
int indent)
throws IOException
outStream - indent -
IOException
public void write2Stream(OutputStream outStream,
int indent,
boolean bPreserveSpace)
throws IOException
outStream - indent - bPreserveSpace -
IOException
@Deprecated
public static void write2StreamStatic(Element elem,
OutputStream outStream,
int indent)
throws IOException
elem - outStream - indent -
IOException
@Deprecated
public static void write2StreamStatic(Element elem,
OutputStream outStream,
int indent,
boolean bPreserveSpace)
throws IOException
elem - outStream - indent - bPreserveSpace -
IOExceptionpublic DocumentType getDoctype()
public DOMImplementation getImplementation()
public Element getDocumentElement()
public Element createElement(String elementName)
elementName - name of the element that is created
public DocumentFragment createDocumentFragment()
public Text createTextNode(String data)
data -
public Comment createComment(String data)
data -
public CDATASection createCDATASection(String data)
data - content of the CDATA
public void setXSLTURL(String url)
url - the url of the xslt file
public ProcessingInstruction createProcessingInstruction(String target,
String data)
target - the target "processor channel"data - parameter string to be passed to the target
public Attr createAttribute(String name)
name - attribute name
public EntityReference createEntityReference(String name)
name - name of the entity to refer to
public NodeList getElementsByTagName(String tagname)
tagname - tag name of the elements to find (JDFCoreConstants.star for all elements)
public Node importNode(Node importedNode,
boolean deep)
importedNode - node to importdeep - if true: recurse and import the subtree under the node as well
public Element createElementNS(String namespaceURI,
String qualifiedName)
namespaceURI - the namespace uri of the created elementqualifiedName - name of the element that is created
public Attr createAttributeNS(String namespaceURI,
String qualifiedName)
namespaceURI - namespace URI of the attributequalifiedName - qualified name of the attribute
public NodeList getElementsByTagNameNS(String namespaceURI,
String myLocalName)
namespaceURI - the namespace URI to look formyLocalName - the element name to look for
public Element getElementById(String elementId)
elementId - the element ID to look for
public String getNodeName()
public String getNodeValue()
public void setNodeValue(String nodeValue)
nodeValue - value to set the node topublic void setNSMap(XMLDoc other)
other - value to set the node topublic short getNodeType()
public Node getParentNode()
public NodeList getChildNodes()
public Node getFirstChild()
public Node getLastChild()
public Node getPreviousSibling()
public Node getNextSibling()
public NamedNodeMap getAttributes()
public Node insertBefore(Node newChild,
Node refChild)
newChild - the new child node to insertrefChild - the ref child node, the new node is inserted before it
public Node replaceChild(Node newChild,
Node oldChild)
newChild - the new child node to addoldChild - the old child node to be replaced
public Node removeChild(Node oldChild)
oldChild - the child node to be removed
public Node appendChild(Node newChild)
newChild - new child node to add
public boolean hasChildNodes()
public Node cloneNode(boolean deep)
deep - true: copy children as well
public void normalize()
public boolean isSupported(String feature,
String version)
feature - package name of the feature to testversion - version number of the package name to test
public String getPrefix()
public void setPrefix(String prefix)
prefix - namespace prefixpublic String getLocalName()
public boolean isNull()
public boolean hasAttributes()
public DocumentType createDocumentType(String qualifiedName,
String publicID,
String systemID)
qualifiedName - publicID - systemID -
public void setErrorChecking(boolean check)
check - true - enable error checkingpublic boolean getErrorChecking()
public Entity createEntity(String name)
name - name of the entity
public Notation createNotation(String name)
name - name of the notation
public org.apache.xerces.dom.ElementDefinitionImpl createElementDefinition(String name)
name -
public void putIdentifier(String idName,
Element element)
idName - element - public Element getIdentifier(String idName)
idName - name of the element to get
public void removeIdentifier(String idName)
idName - public Enumeration<?> getIdentifiers()
public org.w3c.dom.traversal.NodeIterator createNodeIterator(Node root,
short whatToShow,
org.w3c.dom.traversal.NodeFilter filter)
root - the root of the iteratorwhatToShow - the whatToShow maskfilter - the node filter (null = no filter)
public org.w3c.dom.traversal.NodeIterator createNodeIterator(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean entityReferenceExpansion)
root - the root of the iteratorwhatToShow - the whatToShow maskfilter - the node filter (null = no filter)entityReferenceExpansion - true: expand the contents of EntityReference nodes
public org.w3c.dom.traversal.TreeWalker createTreeWalker(Node root,
short whatToShow,
org.w3c.dom.traversal.NodeFilter filter)
root - the root of the iteratorwhatToShow - the whatToShow maskfilter - the node filter (null = no filter)
public org.w3c.dom.traversal.TreeWalker createTreeWalker(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean entityReferenceExpansion)
root - the root of the iteratorwhatToShow - the whatToShow maskfilter - the node filter (null = no filter)entityReferenceExpansion - true: expand the contents of EntityReference nodes
public org.w3c.dom.ranges.Range createRange()
public Event createEvent(String type)
type - type of Event interface to be created
public XMLDoc clone()
clone in class Objectpublic String toString()
toString in class Objectpublic String toXML()
protected void setMemberDoc(DocumentXMLImpl myDoc)
public XMLDoc write2URL(String strURL,
String strContentType)
strURL and receives the response in the returned XMLDoc.
strURL - the URL to write tostrContentType - the content type to write to
protected XMLParser getXMLParser()
public HttpURLConnection write2HTTPURL(URL url,
String strContentType,
UrlUtil.HTTPDetails det)
url - the url to write tostrContentType - the content type; if null use text/xmldet - the details to set
public UrlPart write2HttpURL(URL url,
String strContentType,
UrlUtil.HTTPDetails det)
url - the url to write tostrContentType - the content type; if null use text/xmldet - the details to set
public long getDocMemoryUsed()
public javax.mail.BodyPart getBodyPart()
public javax.mail.Multipart getMultiPart()
public void setBodyPart(javax.mail.BodyPart bodyPart)
bodyPart - the value to setpublic void setZipReader(ZipReader zip)
zip - the value to setpublic ZipReader getZipReader()
public String getOriginalFileName()
public void setOriginalFileName(String originalFileName)
originalFileName - The OriginalFileName to set.public String getSchemaLocation(String nsURI)
nsURI - the namespace uri to get the schema location for
public File getSchemaLocationFile(String nsURI)
nsURI - the namespace uri to get the schema location for
public void setSchemaLocation(String nsURI,
File _schemaLocation)
nsURI - _schemaLocation - public void setValidationResult(XMLDoc validationResult)
validationResult - the validationResult to set.public static XMLDoc parseStream(InputStream is)
is -
public static XMLDoc parseFile(String fileName)
fileName -
public static XMLDoc parseFile(File file)
file -
public static XMLDoc parseURL(String url,
javax.mail.BodyPart bp)
url - the url to searchbp - the bodypart that the CID url is located in
public void copyMeta(XMLDoc dMine)
dMine -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||