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
Handles xhtml but only css styling is honored,
no presentational html attributes (see css 2.1 spec, 6.4.4)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate static StylesheetInfoprivate static boolean(package private) static final StringDescription of the Field -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringcollapseWhiteSpace(String text) protected StringconvertToLength(String value) private ElementfindFirstChild(Element parent, String targetName) protected StringgetAttribute(Element e, String attrName) Gets the class attribute of the XhtmlNamespaceHandler objectprivate StringGet the Content-Language meta tag value from the head section of the doc or the empty string.getDefaultStylesheet(StylesheetFactory factory) private InputStreamgetDocumentTitle(Document doc) Returns the title of the document as located in the contents of /html/head/title, or "" if none could be found.Gets the elementStyling attribute of the XhtmlNamespaceHandler objectGets the iD attribute of the XhtmlNamespaceHandler objectGets 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.Gets the linkUri attribute of the XhtmlNamespaceHandler objectgetMetaInfo(Document doc) Gets the namespace attribute of the XhtmlNamespaceHandler objectgetStylesheets(Document doc) Gets the stylesheetLinks attribute of the XhtmlNamespaceHandler objectprotected booleanprotected StylesheetInforeadLinkElement(Element link) protected StylesheetInforeadStyleElement(Element style) private static StringreadTextContent(Element element) Methods inherited from class com.openhtmltopdf.simple.NoNamespaceHandler
getAttributeValue, getAttributeValue, getImageSourceURI, getNonCssStyling, isFormElement, isImageElement
-
Field Details
-
_namespace
Description of the Field- See Also:
-
_defaultStylesheet
-
_defaultStylesheetError
private static boolean _defaultStylesheetError -
_contentLanguageMetaValue
-
-
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
-
readTextContent
-
collapseWhiteSpace
-
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- Parameters:
e-
-
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
-
findFirstChild
-
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
-
getDefaultStylesheetStream
-
getMetaInfo
-
getContentLanguageMetaTag
Get the Content-Language meta tag value from the head section of the doc or the empty string. Caches value so can be called multiple times without performance issues. -
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
-