info.informatica.doc.dom4j
Class XHTMLDocument

java.lang.Object
  extended by org.dom4j.tree.AbstractNode
      extended by org.dom4j.tree.AbstractBranch
          extended by org.dom4j.tree.AbstractDocument
              extended by org.dom4j.tree.DefaultDocument
                  extended by org.dom4j.dom.DOMDocument
                      extended by info.informatica.doc.dom4j.XHTMLDocument
All Implemented Interfaces:
Serializable, Cloneable, org.dom4j.Branch, org.dom4j.Document, org.dom4j.Node

public class XHTMLDocument
extends org.dom4j.dom.DOMDocument

XHTML-specific implementation of a DOM4J Document.

Author:
Carlos Amengual
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.dom4j.tree.DefaultDocument
EMPTY_ITERATOR, EMPTY_LIST
 
Fields inherited from class org.dom4j.tree.AbstractDocument
encoding
 
Fields inherited from class org.dom4j.tree.AbstractBranch
DEFAULT_CONTENT_LIST_SIZE
 
Fields inherited from class org.dom4j.tree.AbstractNode
NODE_TYPE_NAMES
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface org.dom4j.Node
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE
 
Constructor Summary
XHTMLDocument()
           
XHTMLDocument(org.dom4j.dom.DOMDocumentType docType)
           
XHTMLDocument(org.dom4j.dom.DOMElement rootElement)
           
XHTMLDocument(org.dom4j.dom.DOMElement rootElement, org.dom4j.dom.DOMDocumentType docType)
           
XHTMLDocument(String name)
           
XHTMLDocument(String name, org.dom4j.dom.DOMElement rootElement, org.dom4j.dom.DOMDocumentType docType)
           
 
Method Summary
 void addStyleSheet(org.w3c.css.sac.InputSource cssSrc)
          Adds a style sheet (contained by the given InputSource) to the global style sheet defined by the document's default style sheet and all the linked and embedded styles.
protected  String elementID(org.dom4j.Element element)
           
 URL getBaseURL()
          Gets the Base URL of this Document.
 DOM4JCSSStyleSheet getDefaultStyleSheet()
          Gets the default CSS style sheet to be used by this document.
 StyleDatabase getStyleDatabase()
          Gets the style database that applies to the styles in this document.
 DOM4JCSSStyleSheet getStyleSheet()
          Gets the style sheet that applies to this document.
 URL getURL(String uri)
          Gets an URL for the given URI, taking into account the Base URL if appropriate.
 URLConnection openConnection(String uri)
          Opens a connection for the given URI, taking into account the Base URL if needed.
 InputStream openStream(String uri)
          Opens an InputStream for the given URI, taking into account the Base URL if needed.
 void setBaseURL(URL baseURL)
          Sets the Base URL of this Document.
 void setDefaultStyleSheet(DOM4JCSSStyleSheet styleSheet)
          Sets the default CSS style sheet to be used by this document.
 void setStyleDatabase(StyleDatabase styleDb)
          Set the style database to be applied to all styles.
 void setUserImportantStyleDeclaration(BaseCSSStyleDeclaration style)
          Sets the CSS style declaration defined by the end-user as of "important" priority.
 
Methods inherited from class org.dom4j.dom.DOMDocument
appendChild, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getAttributes, getChildNodes, getDoctype, getDocumentElement, getDocumentFactory, getElementById, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getImplementation, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, importNode, insertBefore, isSupported, removeChild, replaceChild, setNodeValue, setPrefix, supports
 
Methods inherited from class org.dom4j.tree.DefaultDocument
addDocType, addNode, addNode, clearContent, clone, contentList, getDocType, getEntityResolver, getName, getRootElement, getXMLEncoding, processingInstruction, processingInstructions, processingInstructions, removeNode, removeProcessingInstruction, rootElementAdded, setContent, setDocType, setDocumentFactory, setEntityResolver, setName
 
Methods inherited from class org.dom4j.tree.AbstractDocument
accept, add, addComment, addElement, addElement, addElement, addProcessingInstruction, addProcessingInstruction, asXML, asXPathResult, checkAddElementAllowed, childAdded, childRemoved, getDocument, getNodeType, getPath, getStringValue, getUniquePath, normalize, remove, setRootElement, setXMLEncoding, toString, write
 
Methods inherited from class org.dom4j.tree.AbstractBranch
add, add, add, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, getContentAsStringValue, getContentAsText, getText, getTextTrim, hasContent, indexOf, invalidNodeTypeAddException, isReadOnly, node, nodeCount, nodeIterator, remove, remove, remove, setProcessingInstructions
 
Methods inherited from class org.dom4j.tree.AbstractNode
createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getParent, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOf
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Document
adoptNode, getDocumentURI, getDomConfig, getInputEncoding, getStrictErrorChecking, getXmlEncoding, getXmlStandalone, getXmlVersion, normalizeDocument, renameNode, setDocumentURI, setStrictErrorChecking, setXmlStandalone, setXmlVersion
 
Methods inherited from interface org.w3c.dom.Node
compareDocumentPosition, getBaseURI, getFeature, getNodeType, getTextContent, getUserData, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, normalize, setTextContent, setUserData
 
Methods inherited from interface org.dom4j.Branch
add, add, add, appendContent, content, elementByID, indexOf, node, nodeCount, nodeIterator, remove, remove, remove, setProcessingInstructions
 
Methods inherited from interface org.dom4j.Node
createXPath, detach, getNodeTypeName, getParent, getPath, getText, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOf
 

Constructor Detail

XHTMLDocument

public XHTMLDocument()

XHTMLDocument

public XHTMLDocument(String name)

XHTMLDocument

public XHTMLDocument(org.dom4j.dom.DOMElement rootElement)

XHTMLDocument

public XHTMLDocument(org.dom4j.dom.DOMDocumentType docType)

XHTMLDocument

public XHTMLDocument(org.dom4j.dom.DOMElement rootElement,
                     org.dom4j.dom.DOMDocumentType docType)

XHTMLDocument

public XHTMLDocument(String name,
                     org.dom4j.dom.DOMElement rootElement,
                     org.dom4j.dom.DOMDocumentType docType)
Method Detail

elementID

protected String elementID(org.dom4j.Element element)
Overrides:
elementID in class org.dom4j.tree.AbstractBranch

getStyleSheet

public DOM4JCSSStyleSheet getStyleSheet()
Gets the style sheet that applies to this document.

The style sheet is built lazily, starting with a default style sheet, and then adding the linked and embedded sheets in the document.

Returns:
the style sheet that applies to this document.

addStyleSheet

public void addStyleSheet(org.w3c.css.sac.InputSource cssSrc)
                   throws DOMException,
                          IOException,
                          org.w3c.css.sac.CSSException
Adds a style sheet (contained by the given InputSource) to the global style sheet defined by the document's default style sheet and all the linked and embedded styles.

Parameters:
cssSrc -
Throws:
DOMException
IOException
org.w3c.css.sac.CSSException

getDefaultStyleSheet

public DOM4JCSSStyleSheet getDefaultStyleSheet()
Gets the default CSS style sheet to be used by this document.

Returns:
the default style sheet.

setDefaultStyleSheet

public void setDefaultStyleSheet(DOM4JCSSStyleSheet styleSheet)
Sets the default CSS style sheet to be used by this document.

Parameters:
styleSheet - the default style sheet.

setUserImportantStyleDeclaration

public void setUserImportantStyleDeclaration(BaseCSSStyleDeclaration style)
Sets the CSS style declaration defined by the end-user as of "important" priority.

Parameters:
style - the user "important" style declaration.

getStyleDatabase

public StyleDatabase getStyleDatabase()
Gets the style database that applies to the styles in this document.

Returns:
the style database.

setStyleDatabase

public void setStyleDatabase(StyleDatabase styleDb)
Set the style database to be applied to all styles.

Parameters:
styleDb - the style database.

getBaseURL

public URL getBaseURL()
Gets the Base URL of this Document.

Returns:
the base URL.

setBaseURL

public void setBaseURL(URL baseURL)
Sets the Base URL of this Document.

Parameters:
baseURL - the base URL.

getURL

public URL getURL(String uri)
           throws MalformedURLException
Gets an URL for the given URI, taking into account the Base URL if appropriate.

Parameters:
uri - the uri.
Returns:
the absolute URL.
Throws:
MalformedURLException - if the uri was wrong.

openConnection

public URLConnection openConnection(String uri)
                             throws IOException
Opens a connection for the given URI, taking into account the Base URL if needed.

Parameters:
uri - the uri to open a connection.
Returns:
the URL connection.
Throws:
IOException - if the uri was wrong, or the stream could not be opened.

openStream

public InputStream openStream(String uri)
                       throws IOException
Opens an InputStream for the given URI, taking into account the Base URL if needed.

Parameters:
uri - the uri to open a connection.
Returns:
the InputStream.
Throws:
IOException - if the uri was wrong, or the stream could not be opened.


Copyright © 2011 informatica.info. All Rights Reserved.