Package org.xhtmlrenderer.extend
Interface NamespaceHandler
-
- All Known Implementing Classes:
NoNamespaceHandler,XhtmlCssOnlyNamespaceHandler,XhtmlNamespaceHandler,XhtmlNamespaceHandler
@ParametersAreNonnullByDefault public interface NamespaceHandlerProvides knowledge specific to a certain document type, like resolving style-sheets- Author:
- Torbjoern Gannholm
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAnchorName(Element e)StringgetAttributeValue(Element e, String attrName)may return null.StringgetAttributeValue(Element e, String namespaceURI, String attrName)StringgetClass(Element e)StylesheetInfogetDefaultStylesheet(StylesheetFactory factory)StringgetDocumentTitle(Document doc)StringgetElementStyling(Element e)StringgetID(Element e)StringgetImageSourceURI(Element e)For an element where isImageElement returns true, retrieves the URI associated with that Image, as reported by the element; makes no guarantee that the URI is correct, complete or points to anything in particular.StringgetLang(Element e)StringgetLinkUri(Element e)should return null if element is not a linkStringgetNamespace()StringgetNonCssStyling(Element e)List<StylesheetInfo>getStylesheets(Document doc)booleanisFormElement(Element e)Determines whether the specified Element represents a <form>.booleanisImageElement(Element e)
-
-
-
Method Detail
-
getNamespace
@Nonnull @CheckReturnValue String getNamespace()
- Returns:
- the namespace handled
-
getDefaultStylesheet
@Nullable @CheckReturnValue StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
- Returns:
- the default CSS stylesheet for this namespace
-
getDocumentTitle
@Nullable @CheckReturnValue String getDocumentTitle(Document doc)
- Parameters:
doc- the document- Returns:
- the title for this document, if any exists
-
getStylesheets
@Nonnull @CheckReturnValue List<StylesheetInfo> getStylesheets(Document doc)
- Parameters:
doc- the document- Returns:
- all links to CSS stylesheets (type="text/css") in this document
-
getAttributeValue
@Nonnull @CheckReturnValue String getAttributeValue(Element e, String attrName)
may return null. Required to return null if attribute does not exist and not null if attribute exists.
-
getAttributeValue
@Nonnull @CheckReturnValue String getAttributeValue(Element e, @Nullable String namespaceURI, String attrName)
-
getNonCssStyling
@Nullable @CheckReturnValue String getNonCssStyling(Element e)
- Returns:
- The corresponding css properties for styling that is obtained in other ways.
-
getLinkUri
@Nullable @CheckReturnValue String getLinkUri(Element e)
should return null if element is not a link
-
isImageElement
@CheckReturnValue boolean isImageElement(Element e)
- Returns:
- Returns true if the Element represents an image.
-
isFormElement
@CheckReturnValue boolean isFormElement(Element e)
Determines whether the specified Element represents a <form>.- Parameters:
e- The Element to evaluate.- Returns:
- true if the Element is a <form> element, false otherwise.
-
getImageSourceURI
@Nullable @CheckReturnValue String getImageSourceURI(Element e)
For an element where isImageElement returns true, retrieves the URI associated with that Image, as reported by the element; makes no guarantee that the URI is correct, complete or points to anything in particular. For elements whereisImageElement(Element)returns false, this method may return false, and may also return false if the Element is not correctly formed and contains no URI; check the return value carefully.- Parameters:
e- The element to extract image info from.- Returns:
- String containing the URI for the image.
-
-