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
,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 StylesheetInfo
private static boolean
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
collapseWhiteSpace
(String text) protected String
convertToLength
(String value) private Element
findFirstChild
(Element parent, String targetName) protected String
getAttribute
(Element e, String attrName) Gets the class attribute of the XhtmlNamespaceHandler objectgetDefaultStylesheet
(StylesheetFactory factory) private InputStream
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 objectGets the iD attribute of the XhtmlNamespaceHandler objectGets 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 StylesheetInfo
readLinkElement
(Element link) protected StylesheetInfo
readStyleElement
(Element style) Methods inherited from class org.xhtmlrenderer.simple.NoNamespaceHandler
getAttributeValue, getAttributeValue, getImageSourceURI, getNonCssStyling, isFormElement, isImageElement
-
Field Details
-
_namespace
- See Also:
-
_defaultStylesheet
-
_defaultStylesheetError
private static boolean _defaultStylesheetError
-
-
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
-
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
- Returns:
- the default CSS stylesheet for this namespace
-
getDefaultStylesheetStream
-
getMetaInfo
-
getLang
- Specified by:
getLang
in interfaceNamespaceHandler
- Overrides:
getLang
in classNoNamespaceHandler
-