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
@ParametersAreNonnullByDefault 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
All Methods Instance Methods Concrete Methods 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)StringgetLinkUri(Element e)Gets the linkUri attribute of the XhtmlNamespaceHandler objectStringgetNamespace()Gets the namespace attribute of the XhtmlNamespaceHandler objectList<StylesheetInfo>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 org.xhtmlrenderer.simple.NoNamespaceHandler
getAttributeValue, getAttributeValue, getImageSourceURI, getNonCssStyling, isFormElement, isImageElement
-
-
-
-
Method Detail
-
getNamespace
@Nonnull @CheckReturnValue public String getNamespace()
Gets the namespace attribute of the XhtmlNamespaceHandler object- Specified by:
getNamespacein interfaceNamespaceHandler- Overrides:
getNamespacein classNoNamespaceHandler- Returns:
- The namespace value
-
getClass
@Nonnull @CheckReturnValue public String getClass(Element e)
Gets the class attribute of the XhtmlNamespaceHandler object- Specified by:
getClassin interfaceNamespaceHandler- Overrides:
getClassin classNoNamespaceHandler
-
getID
@Nullable @CheckReturnValue public String getID(Element e)
Gets the iD attribute of the XhtmlNamespaceHandler object- Specified by:
getIDin interfaceNamespaceHandler- Overrides:
getIDin classNoNamespaceHandler
-
isInteger
protected boolean isInteger(String value)
-
getElementStyling
@Nonnull @CheckReturnValue public String getElementStyling(Element e)
Gets the elementStyling attribute of the XhtmlNamespaceHandler object- Specified by:
getElementStylingin interfaceNamespaceHandler- Overrides:
getElementStylingin classNoNamespaceHandler- Returns:
- The elementStyling value
-
getLinkUri
@Nullable @CheckReturnValue public String getLinkUri(Element e)
Gets the linkUri attribute of the XhtmlNamespaceHandler object- Specified by:
getLinkUriin interfaceNamespaceHandler- Overrides:
getLinkUriin classNoNamespaceHandler
-
getAnchorName
@Nullable @CheckReturnValue public String getAnchorName(Element e)
- Specified by:
getAnchorNamein interfaceNamespaceHandler- Overrides:
getAnchorNamein classNoNamespaceHandler
-
getDocumentTitle
@Nonnull @CheckReturnValue 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
@Nonnull @CheckReturnValue public List<StylesheetInfo> getStylesheets(Document doc)
Gets the stylesheetLinks attribute of the XhtmlNamespaceHandler object- Specified by:
getStylesheetsin interfaceNamespaceHandler- Overrides:
getStylesheetsin classNoNamespaceHandler- Parameters:
doc- the document- Returns:
- all links to CSS stylesheets (type="text/css") in this document
-
getDefaultStylesheet
@Nullable @CheckReturnValue public StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
- Specified by:
getDefaultStylesheetin interfaceNamespaceHandler- Overrides:
getDefaultStylesheetin classNoNamespaceHandler- Returns:
- the default CSS stylesheet for this namespace
-
getLang
@Nonnull @CheckReturnValue public String getLang(@Nullable Element e)
- Specified by:
getLangin interfaceNamespaceHandler- Overrides:
getLangin classNoNamespaceHandler
-
-