Package org.xhtmlrenderer.swing
Class NoNamespaceHandler
- java.lang.Object
-
- 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
Constructors Constructor Description NoNamespaceHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 nullStylesheetInfo
getDefaultStylesheet(StylesheetFactory factory)
java.lang.String
getDocumentTitle(org.w3c.dom.Document doc)
java.lang.String
getElementStyling(org.w3c.dom.Element e)
may return nulljava.lang.String
getID(org.w3c.dom.Element e)
may return nulljava.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 nulljava.lang.String
getLinkUri(org.w3c.dom.Element e)
should return null if element is not a linkjava.lang.String
getNamespace()
java.lang.String
getNonCssStyling(org.w3c.dom.Element e)
may return nullStylesheetInfo[]
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)
-
-
-
Method Detail
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespace
in interfaceNamespaceHandler
- 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 interfaceNamespaceHandler
- Parameters:
e
- PARAMattrName
- 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 interfaceNamespaceHandler
-
getClass
public java.lang.String getClass(org.w3c.dom.Element e)
Description copied from interface:NamespaceHandler
may return null- Specified by:
getClass
in interfaceNamespaceHandler
- 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 interfaceNamespaceHandler
- 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 interfaceNamespaceHandler
- 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 interfaceNamespaceHandler
- 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 interfaceNamespaceHandler
- 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 interfaceNamespaceHandler
- Parameters:
e
- PARAM- Returns:
- The linkUri value
-
getDocumentTitle
public java.lang.String getDocumentTitle(org.w3c.dom.Document doc)
- Specified by:
getDocumentTitle
in interfaceNamespaceHandler
- Returns:
- the title for this document, if any exists
-
getAnchorName
public java.lang.String getAnchorName(org.w3c.dom.Element e)
- Specified by:
getAnchorName
in interfaceNamespaceHandler
-
isImageElement
public boolean isImageElement(org.w3c.dom.Element e)
- Specified by:
isImageElement
in interfaceNamespaceHandler
- 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 whereNamespaceHandler.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 interfaceNamespaceHandler
- 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 interfaceNamespaceHandler
- 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 interfaceNamespaceHandler
- Returns:
- all links to CSS stylesheets (type="text/css") in this document
-
getDefaultStylesheet
public StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
- Specified by:
getDefaultStylesheet
in interfaceNamespaceHandler
- Returns:
- the default CSS stylesheet for this namespace
-
-