org.xhtmlrenderer.simple.extend
Class XhtmlCssOnlyNamespaceHandler

java.lang.Object
  extended by org.xhtmlrenderer.simple.NoNamespaceHandler
      extended by org.xhtmlrenderer.simple.extend.XhtmlCssOnlyNamespaceHandler
All Implemented Interfaces:
NamespaceHandler
Direct Known Subclasses:
XhtmlNamespaceHandler, XhtmlNamespaceHandler

public class XhtmlCssOnlyNamespaceHandler
extends NoNamespaceHandler

Handles xhtml but only css styling is honored, no presentational html attributes (see css 2.1 spec, 6.4.4)


Constructor Summary
XhtmlCssOnlyNamespaceHandler()
           
 
Method Summary
protected  String convertToLength(String value)
           
 String getAnchorName(Element e)
           
protected  String getAttribute(Element e, String attrName)
           
 String getClass(Element e)
          Gets the class attribute of the XhtmlNamespaceHandler object
 StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
           
 String getDocumentTitle(Document doc)
          Returns the title of the document as located in the contents of /html/head/title, or "" if none could be found.
 String getElementStyling(Element e)
          Gets the elementStyling attribute of the XhtmlNamespaceHandler object
 String getID(Element e)
          Gets the iD attribute of the XhtmlNamespaceHandler object
 String getLang(Element e)
          may return null
 String getLinkUri(Element e)
          Gets the linkUri attribute of the XhtmlNamespaceHandler object
 String getNamespace()
          Gets the namespace attribute of the XhtmlNamespaceHandler object
 StylesheetInfo[] getStylesheets(Document doc)
          Gets the stylesheetLinks attribute of the XhtmlNamespaceHandler object
protected  boolean isInteger(String value)
           
protected  StylesheetInfo readLinkElement(Element link)
           
protected  StylesheetInfo readStyleElement(Element style)
           
 
Methods inherited from class org.xhtmlrenderer.simple.NoNamespaceHandler
getAttributeValue, getAttributeValue, getImageSourceURI, getNonCssStyling, isFormElement, isImageElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XhtmlCssOnlyNamespaceHandler

public XhtmlCssOnlyNamespaceHandler()
Method Detail

getNamespace

public String getNamespace()
Gets the namespace attribute of the XhtmlNamespaceHandler object

Specified by:
getNamespace in interface NamespaceHandler
Overrides:
getNamespace in class NoNamespaceHandler
Returns:
The namespace value

getClass

public String getClass(Element e)
Gets the class attribute of the XhtmlNamespaceHandler object

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

getID

public String getID(Element e)
Gets the iD attribute of the XhtmlNamespaceHandler object

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

convertToLength

protected String convertToLength(String value)

isInteger

protected boolean isInteger(String value)

getAttribute

protected String getAttribute(Element e,
                              String attrName)

getElementStyling

public String getElementStyling(Element e)
Gets the elementStyling attribute of the XhtmlNamespaceHandler object

Specified by:
getElementStyling in interface NamespaceHandler
Overrides:
getElementStyling in class NoNamespaceHandler
Parameters:
e - PARAM
Returns:
The elementStyling value

getLinkUri

public String getLinkUri(Element e)
Gets the linkUri attribute of the XhtmlNamespaceHandler object

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

getAnchorName

public String getAnchorName(Element e)
Specified by:
getAnchorName in interface NamespaceHandler
Overrides:
getAnchorName in class NoNamespaceHandler

getDocumentTitle

public String getDocumentTitle(Document doc)
Returns the title of the document as located in the contents of /html/head/title, or "" if none could be found.

Specified by:
getDocumentTitle in interface NamespaceHandler
Overrides:
getDocumentTitle in class NoNamespaceHandler
Parameters:
doc - the document to search for a title
Returns:
The document's title, or "" if none found

readStyleElement

protected StylesheetInfo readStyleElement(Element style)

readLinkElement

protected StylesheetInfo readLinkElement(Element link)

getStylesheets

public StylesheetInfo[] getStylesheets(Document doc)
Gets the stylesheetLinks attribute of the XhtmlNamespaceHandler object

Specified by:
getStylesheets in interface NamespaceHandler
Overrides:
getStylesheets in class NoNamespaceHandler
Parameters:
doc - PARAM
Returns:
The stylesheetLinks value

getDefaultStylesheet

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

getLang

public String getLang(Element e)
Description copied from interface: NamespaceHandler
may return null

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


Copyright © 2013. All Rights Reserved.