Package com.openhtmltopdf.simple.extend
Class XhtmlCssOnlyNamespaceHandler
- java.lang.Object
-
- com.openhtmltopdf.simple.NoNamespaceHandler
-
- com.openhtmltopdf.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
Constructors Constructor Description XhtmlCssOnlyNamespaceHandler()
-
Method Summary
Modifier and Type Method Description protected StringconvertToLength(String value)StringgetAnchorName(Element e)protected StringgetAttribute(Element e, String attrName)StringgetClass(Element e)Gets the class attribute of the XhtmlNamespaceHandler objectStylesheetInfogetDefaultStylesheet(StylesheetFactory factory)StringgetDocumentTitle(Document doc)Returns the title of the document as located in the contents of /html/head/title, or "" if none could be found.StringgetElementStyling(Element e)Gets the elementStyling attribute of the XhtmlNamespaceHandler objectStringgetID(Element e)Gets the iD attribute of the XhtmlNamespaceHandler objectStringgetLang(Element e)may return nullStringgetLinkUri(Element e)Gets the linkUri attribute of the XhtmlNamespaceHandler objectStringgetNamespace()Gets the namespace attribute of the XhtmlNamespaceHandler objectStylesheetInfo[]getStylesheets(Document doc)Gets the stylesheetLinks attribute of the XhtmlNamespaceHandler objectprotected booleanisInteger(String value)protected StylesheetInforeadLinkElement(Element link)protected StylesheetInforeadStyleElement(Element style)-
Methods inherited from class com.openhtmltopdf.simple.NoNamespaceHandler
getAttributeValue, getAttributeValue, getImageSourceURI, getNonCssStyling, isFormElement, isImageElement
-
-
-
-
Method Detail
-
getNamespace
public String getNamespace()
Gets the namespace attribute of the XhtmlNamespaceHandler object- Specified by:
getNamespacein interfaceNamespaceHandler- Overrides:
getNamespacein classNoNamespaceHandler- Returns:
- The namespace value
-
getClass
public String getClass(Element e)
Gets the class attribute of the XhtmlNamespaceHandler object- Specified by:
getClassin interfaceNamespaceHandler- Overrides:
getClassin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The class value
-
getID
public String getID(Element e)
Gets the iD attribute of the XhtmlNamespaceHandler object- Specified by:
getIDin interfaceNamespaceHandler- Overrides:
getIDin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The iD value
-
isInteger
protected boolean isInteger(String value)
-
getLinkUri
public String getLinkUri(Element e)
Gets the linkUri attribute of the XhtmlNamespaceHandler object- Specified by:
getLinkUriin interfaceNamespaceHandler- Overrides:
getLinkUriin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The linkUri value
-
getAnchorName
public String getAnchorName(Element e)
- Specified by:
getAnchorNamein interfaceNamespaceHandler- Overrides:
getAnchorNamein classNoNamespaceHandler
-
getElementStyling
public String getElementStyling(Element e)
Gets the elementStyling attribute of the XhtmlNamespaceHandler object- Specified by:
getElementStylingin interfaceNamespaceHandler- Overrides:
getElementStylingin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The elementStyling value
-
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:
getDocumentTitlein interfaceNamespaceHandler- Overrides:
getDocumentTitlein classNoNamespaceHandler- 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:
getStylesheetsin interfaceNamespaceHandler- Overrides:
getStylesheetsin classNoNamespaceHandler- Parameters:
doc- PARAM- Returns:
- The stylesheetLinks value
-
getDefaultStylesheet
public StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
- Specified by:
getDefaultStylesheetin interfaceNamespaceHandler- Overrides:
getDefaultStylesheetin classNoNamespaceHandler- Returns:
- the default CSS stylesheet for this namespace
-
getLang
public String getLang(Element e)
Description copied from interface:NamespaceHandlermay return null- Specified by:
getLangin interfaceNamespaceHandler- Overrides:
getLangin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The lang value
-
-