Flying Saucer Project Release ${app.version}

org.xhtmlrenderer.swing
Class NoNamespaceHandler

java.lang.Object
  extended by org.xhtmlrenderer.swing.NoNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
Direct Known Subclasses:
XhtmlCssOnlyNamespaceHandler

public class NoNamespaceHandler
extends java.lang.Object
implements NamespaceHandler

Handles a general XML document

Author:
Torbjörn Gannholm

Constructor Summary
NoNamespaceHandler()
           
 
Method Summary
 java.lang.String getAnchorName(org.w3c.dom.Element e)
           
 java.lang.String getAttributeValue(org.w3c.dom.Element e, java.lang.String attrName)
          may return null.
 java.lang.String getAttributeValue(org.w3c.dom.Element e, java.lang.String namespaceURI, java.lang.String attrName)
           
 java.lang.String getClass(org.w3c.dom.Element e)
          may return null
 StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
           
 java.lang.String getDocumentTitle(org.w3c.dom.Document doc)
           
 java.lang.String getElementStyling(org.w3c.dom.Element e)
          may return null
 java.lang.String getID(org.w3c.dom.Element e)
          may return null
 java.lang.String getImageSourceURI(org.w3c.dom.Element e)
          For an element where isImageElement returns true, retrieves the URI associated with that Image, as reported by the element; makes no guarrantee that the URI is correct, complete or points to anything in particular.
 java.lang.String getLang(org.w3c.dom.Element e)
          may return null
 java.lang.String getLinkUri(org.w3c.dom.Element e)
          should return null if element is not a link
 java.lang.String getNamespace()
           
 java.lang.String getNonCssStyling(org.w3c.dom.Element e)
          may return null
 StylesheetInfo[] getStylesheets(org.w3c.dom.Document doc)
           
 boolean isFormElement(org.w3c.dom.Element e)
          Determines whether or not the specified Element represents a <form>.
 boolean isImageElement(org.w3c.dom.Element e)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoNamespaceHandler

public NoNamespaceHandler()
Method Detail

getNamespace

public java.lang.String getNamespace()
Specified by:
getNamespace in interface NamespaceHandler
Returns:
the namespace handled

getAttributeValue

public java.lang.String getAttributeValue(org.w3c.dom.Element e,
                                          java.lang.String attrName)
Description copied from interface: NamespaceHandler
may return null. Required to return null if attribute does not exist and not null if attribute exists.

Specified by:
getAttributeValue in interface NamespaceHandler
Parameters:
e - PARAM
attrName - PARAM
Returns:
The attributeValue value

getAttributeValue

public java.lang.String getAttributeValue(org.w3c.dom.Element e,
                                          java.lang.String namespaceURI,
                                          java.lang.String attrName)
Specified by:
getAttributeValue in interface NamespaceHandler

getClass

public java.lang.String getClass(org.w3c.dom.Element e)
Description copied from interface: NamespaceHandler
may return null

Specified by:
getClass in interface NamespaceHandler
Parameters:
e - PARAM
Returns:
The class value

getID

public java.lang.String getID(org.w3c.dom.Element e)
Description copied from interface: NamespaceHandler
may return null

Specified by:
getID in interface NamespaceHandler
Parameters:
e - PARAM
Returns:
The iD value

getLang

public java.lang.String getLang(org.w3c.dom.Element e)
Description copied from interface: NamespaceHandler
may return null

Specified by:
getLang in interface NamespaceHandler
Parameters:
e - PARAM
Returns:
The lang value

getElementStyling

public java.lang.String getElementStyling(org.w3c.dom.Element e)
Description copied from interface: NamespaceHandler
may return null

Specified by:
getElementStyling in interface NamespaceHandler
Parameters:
e - PARAM
Returns:
The elementStyling value (style attribute)

getNonCssStyling

public java.lang.String getNonCssStyling(org.w3c.dom.Element e)
Description copied from interface: NamespaceHandler
may return null

Specified by:
getNonCssStyling in interface NamespaceHandler
Returns:
The corresponding css properties for styling that is obtained in other ways.

getLinkUri

public java.lang.String getLinkUri(org.w3c.dom.Element e)
Description copied from interface: NamespaceHandler
should return null if element is not a link

Specified by:
getLinkUri in interface NamespaceHandler
Parameters:
e - PARAM
Returns:
The linkUri value

getDocumentTitle

public java.lang.String getDocumentTitle(org.w3c.dom.Document doc)
Specified by:
getDocumentTitle in interface NamespaceHandler
Returns:
the title for this document, if any exists

getAnchorName

public java.lang.String getAnchorName(org.w3c.dom.Element e)
Specified by:
getAnchorName in interface NamespaceHandler

isImageElement

public boolean isImageElement(org.w3c.dom.Element e)
Specified by:
isImageElement in interface NamespaceHandler
Returns:
Returns true if the Element represents an image.

getImageSourceURI

public java.lang.String getImageSourceURI(org.w3c.dom.Element e)
Description copied from interface: NamespaceHandler
For an element where isImageElement returns true, retrieves the URI associated with that Image, as reported by the element; makes no guarrantee that the URI is correct, complete or points to anything in particular. For elements where NamespaceHandler.isImageElement(org.w3c.dom.Element) returns false, this method may return false, and may also return false if the Element is not correctly formed and contains no URI; check the return value carefully.

Specified by:
getImageSourceURI in interface NamespaceHandler
Parameters:
e - The element to extract image info from.
Returns:
String containing the URI for the image.

isFormElement

public boolean isFormElement(org.w3c.dom.Element e)
Description copied from interface: NamespaceHandler
Determines whether or not the specified Element represents a <form>.

Specified by:
isFormElement in interface NamespaceHandler
Parameters:
e - The Element to evaluate.
Returns:
true if the Element is a <form> element, false otherwise.

getStylesheets

public StylesheetInfo[] getStylesheets(org.w3c.dom.Document doc)
Specified by:
getStylesheets in interface NamespaceHandler
Returns:
all links to CSS stylesheets (type="text/css") in this document

getDefaultStylesheet

public StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
Specified by:
getDefaultStylesheet in interface NamespaceHandler
Returns:
the default CSS stylesheet for this namespace

Flying Saucer Project Release ${app.version}

Flying Saucer Project Home