Package org.xhtmlrenderer.simple
Class NoNamespaceHandler
java.lang.Object
org.xhtmlrenderer.simple.NoNamespaceHandler
- All Implemented Interfaces:
NamespaceHandler
- Direct Known Subclasses:
XhtmlCssOnlyNamespaceHandler
Handles a general XML document
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate @NonNull String
private @Nullable String
detectType
(String pi) private @Nullable String
@Nullable String
getAnchorName
(@Nullable Element e) getAttributeValue
(Element e, @Nullable String namespaceURI, String attrName) getAttributeValue
(Element e, String attrName) may return null.@Nullable String
@Nullable String
getDocumentTitle
(Document doc) @Nullable String
@Nullable String
@Nullable String
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.@Nullable String
should return null if element is not a link@Nullable String
getStylesheets
(Document doc) boolean
Determines whether the specified Element represents a <form>.boolean
-
Field Details
-
_namespace
- See Also:
-
_typePattern
-
_hrefPattern
-
_alternatePattern
-
_mediaPattern
-
-
Constructor Details
-
NoNamespaceHandler
public NoNamespaceHandler()
-
-
Method Details
-
getNamespace
- Specified by:
getNamespace
in interfaceNamespaceHandler
-
getAttributeValue
Description copied from interface:NamespaceHandler
may return null. Required to return null if attribute does not exist and not null if attribute exists.- Specified by:
getAttributeValue
in interfaceNamespaceHandler
-
getAttributeValue
@CheckReturnValue public String getAttributeValue(Element e, @Nullable String namespaceURI, String attrName) - Specified by:
getAttributeValue
in interfaceNamespaceHandler
-
getClass
- Specified by:
getClass
in interfaceNamespaceHandler
-
getID
- Specified by:
getID
in interfaceNamespaceHandler
-
getLang
- Specified by:
getLang
in interfaceNamespaceHandler
-
getElementStyling
- Specified by:
getElementStyling
in interfaceNamespaceHandler
-
getNonCssStyling
- Specified by:
getNonCssStyling
in interfaceNamespaceHandler
- Returns:
- The corresponding css properties for styling that is obtained in other ways.
-
getLinkUri
Description copied from interface:NamespaceHandler
should return null if element is not a link- Specified by:
getLinkUri
in interfaceNamespaceHandler
-
getDocumentTitle
- Specified by:
getDocumentTitle
in interfaceNamespaceHandler
-
getAnchorName
- Specified by:
getAnchorName
in interfaceNamespaceHandler
-
isImageElement
- Specified by:
isImageElement
in interfaceNamespaceHandler
- Returns:
- Returns true if the Element represents an image.
-
getImageSourceURI
Description copied from interface:NamespaceHandler
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 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:
getImageSourceURI
in interfaceNamespaceHandler
- Parameters:
e
- The element to extract image info from.- Returns:
- String containing the URI for the image.
-
isFormElement
Description copied from interface:NamespaceHandler
Determines whether the specified Element represents a <form>.- Specified by:
isFormElement
in interfaceNamespaceHandler
- Parameters:
e
- The Element to evaluate.- Returns:
- true if the Element is a <form> element, false otherwise.
-
getStylesheets
- Specified by:
getStylesheets
in interfaceNamespaceHandler
- Parameters:
doc
- the document- Returns:
- all links to CSS stylesheets (type="text/css") in this document
-
detectType
-
detectUri
-
detectMediaTypes
-
getDefaultStylesheet
- Specified by:
getDefaultStylesheet
in interfaceNamespaceHandler
-