java.lang.Object
org.xhtmlrenderer.simple.NoNamespaceHandler
- All Implemented Interfaces:
NamespaceHandler
- Direct Known Subclasses:
XhtmlCssOnlyNamespaceHandler
Handles a general XML document
- Author:
- Torbjoern Gannholm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetAnchorName(@Nullable Element e) getAttributeValue(Element e, @Nullable String namespaceURI, String attrName) getAttributeValue(Element e, String attrName) may return null.@Nullable String@Nullable StringgetDocumentTitle(Document doc) @Nullable String@Nullable String@Nullable StringFor 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.@Nullable Stringshould return null if element is not a link@Nullable StringgetStylesheets(Document doc) booleanDetermines whether the specified Element represents a <form>.boolean
-
Constructor Details
-
NoNamespaceHandler
public NoNamespaceHandler()
-
-
Method Details
-
getNamespace
- Specified by:
getNamespacein interfaceNamespaceHandler
-
getAttributeValue
Description copied from interface:NamespaceHandlermay return null. Required to return null if attribute does not exist and not null if attribute exists.- Specified by:
getAttributeValuein interfaceNamespaceHandler
-
getAttributeValue
@CheckReturnValue public String getAttributeValue(Element e, @Nullable String namespaceURI, String attrName) - Specified by:
getAttributeValuein interfaceNamespaceHandler
-
getClass
- Specified by:
getClassin interfaceNamespaceHandler
-
getID
- Specified by:
getIDin interfaceNamespaceHandler
-
getLang
- Specified by:
getLangin interfaceNamespaceHandler
-
getElementStyling
- Specified by:
getElementStylingin interfaceNamespaceHandler
-
getNonCssStyling
- Specified by:
getNonCssStylingin interfaceNamespaceHandler- Returns:
- The corresponding css properties for styling that is obtained in other ways.
-
getLinkUri
Description copied from interface:NamespaceHandlershould return null if element is not a link- Specified by:
getLinkUriin interfaceNamespaceHandler
-
getDocumentTitle
- Specified by:
getDocumentTitlein interfaceNamespaceHandler
-
getAnchorName
- Specified by:
getAnchorNamein interfaceNamespaceHandler
-
isImageElement
- Specified by:
isImageElementin interfaceNamespaceHandler- Returns:
- Returns true if the Element represents an image.
-
getImageSourceURI
Description copied from interface:NamespaceHandlerFor 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 whereNamespaceHandler.isImageElement(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.- Specified by:
getImageSourceURIin interfaceNamespaceHandler- Parameters:
e- The element to extract image info from.- Returns:
- String containing the URI for the image.
-
isFormElement
Description copied from interface:NamespaceHandlerDetermines whether the specified Element represents a <form>.- Specified by:
isFormElementin interfaceNamespaceHandler- Parameters:
e- The Element to evaluate.- Returns:
- true if the Element is a <form> element, false otherwise.
-
getStylesheets
- Specified by:
getStylesheetsin interfaceNamespaceHandler- Parameters:
doc- the document- Returns:
- all links to CSS stylesheets (type="text/css") in this document
-
getDefaultStylesheet
- Specified by:
getDefaultStylesheetin interfaceNamespaceHandler
-