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
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)Gets the language of an element as specified (in order of precedence) by the lang attribute on the element itself, the first ancestor with a lang attribute, the Content-Language meta tag or the empty string.StringgetLinkUri(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
-
Constructor Details
-
XhtmlCssOnlyNamespaceHandler
public XhtmlCssOnlyNamespaceHandler()
-
-
Method Details
-
getNamespace
Gets the namespace attribute of the XhtmlNamespaceHandler object- Specified by:
getNamespacein interfaceNamespaceHandler- Overrides:
getNamespacein classNoNamespaceHandler- Returns:
- The namespace value
-
getClass
Gets the class attribute of the XhtmlNamespaceHandler object- Specified by:
getClassin interfaceNamespaceHandler- Overrides:
getClassin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The class value
-
getID
Gets the iD attribute of the XhtmlNamespaceHandler object- Specified by:
getIDin interfaceNamespaceHandler- Overrides:
getIDin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The iD value
-
convertToLength
-
isInteger
-
getAttribute
-
getLinkUri
Gets the linkUri attribute of the XhtmlNamespaceHandler object- Specified by:
getLinkUriin interfaceNamespaceHandler- Overrides:
getLinkUriin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The linkUri value
-
getAnchorName
- Specified by:
getAnchorNamein interfaceNamespaceHandler- Overrides:
getAnchorNamein classNoNamespaceHandler
-
getElementStyling
Gets the elementStyling attribute of the XhtmlNamespaceHandler object- Specified by:
getElementStylingin interfaceNamespaceHandler- Overrides:
getElementStylingin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The elementStyling value
-
getDocumentTitle
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
-
readLinkElement
-
getStylesheets
Gets the stylesheetLinks attribute of the XhtmlNamespaceHandler object- Specified by:
getStylesheetsin interfaceNamespaceHandler- Overrides:
getStylesheetsin classNoNamespaceHandler- Parameters:
doc- PARAM- Returns:
- The stylesheetLinks value
-
getDefaultStylesheet
- Specified by:
getDefaultStylesheetin interfaceNamespaceHandler- Overrides:
getDefaultStylesheetin classNoNamespaceHandler- Returns:
- the default CSS stylesheet for this namespace
-
getLang
Gets the language of an element as specified (in order of precedence) by the lang attribute on the element itself, the first ancestor with a lang attribute, the Content-Language meta tag or the empty string.- Specified by:
getLangin interfaceNamespaceHandler- Overrides:
getLangin classNoNamespaceHandler- Parameters:
e- PARAM- Returns:
- The lang value
-