Package org.xhtmlrenderer.simple.extend
Class XhtmlCssOnlyNamespaceHandler
java.lang.Object
org.xhtmlrenderer.simple.NoNamespaceHandler
org.xhtmlrenderer.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 static @Nullable StylesheetInfo
private static final String
private static final AtomicLong
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
collapseWhiteSpace
(String text) protected String
convertToLength
(String value) private static @NonNull String
extractContent
(Element style) private @Nullable Element
findFirstChild
(Element parent, String targetName) @Nullable String
getAnchorName
(@Nullable Element e) protected @Nullable String
getAttribute
(Element e, String attrName) Gets the class attribute of the XhtmlNamespaceHandler objectprivate @NonNull URL
getDocumentTitle
(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 object@Nullable String
Gets the iD attribute of the XhtmlNamespaceHandler object@Nullable 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 boolean
protected @Nullable StylesheetInfo
readLinkElement
(Element link) protected @Nullable StylesheetInfo
readStyleElement
(Element style) Methods inherited from class org.xhtmlrenderer.simple.NoNamespaceHandler
getAttributeValue, getAttributeValue, getImageSourceURI, getNonCssStyling, isFormElement, isImageElement
-
Field Details
-
_namespace
- See Also:
-
_defaultStylesheet
-
inlineCssCounter
-
-
Constructor Details
-
XhtmlCssOnlyNamespaceHandler
public XhtmlCssOnlyNamespaceHandler()
-
-
Method Details
-
getNamespace
Gets the namespace attribute of the XhtmlNamespaceHandler object- Specified by:
getNamespace
in interfaceNamespaceHandler
- Overrides:
getNamespace
in classNoNamespaceHandler
- Returns:
- The namespace value
-
getClass
Gets the class attribute of the XhtmlNamespaceHandler object- Specified by:
getClass
in interfaceNamespaceHandler
- Overrides:
getClass
in classNoNamespaceHandler
-
getID
Gets the iD attribute of the XhtmlNamespaceHandler object- Specified by:
getID
in interfaceNamespaceHandler
- Overrides:
getID
in classNoNamespaceHandler
-
convertToLength
-
isInteger
-
getAttribute
-
getElementStyling
Gets the elementStyling attribute of the XhtmlNamespaceHandler object- Specified by:
getElementStyling
in interfaceNamespaceHandler
- Overrides:
getElementStyling
in classNoNamespaceHandler
- Returns:
- The elementStyling value
-
getLinkUri
Gets the linkUri attribute of the XhtmlNamespaceHandler object- Specified by:
getLinkUri
in interfaceNamespaceHandler
- Overrides:
getLinkUri
in classNoNamespaceHandler
-
getAnchorName
- Specified by:
getAnchorName
in interfaceNamespaceHandler
- Overrides:
getAnchorName
in classNoNamespaceHandler
-
collapseWhiteSpace
-
getDocumentTitle
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 interfaceNamespaceHandler
- Overrides:
getDocumentTitle
in classNoNamespaceHandler
- Parameters:
doc
- the document to search for a title- Returns:
- The document's title, or "" if none found
-
findFirstChild
-
readStyleElement
-
extractContent
-
readLinkElement
-
getStylesheets
Gets the stylesheetLinks attribute of the XhtmlNamespaceHandler object- Specified by:
getStylesheets
in interfaceNamespaceHandler
- Overrides:
getStylesheets
in classNoNamespaceHandler
- Parameters:
doc
- the document- Returns:
- all links to CSS stylesheets (type="text/css") in this document
-
getDefaultStylesheet
- Specified by:
getDefaultStylesheet
in interfaceNamespaceHandler
- Overrides:
getDefaultStylesheet
in classNoNamespaceHandler
-
getDefaultStylesheetUrl
-
getMetaInfo
-
getLang
- Specified by:
getLang
in interfaceNamespaceHandler
- Overrides:
getLang
in classNoNamespaceHandler
-