Package com.openhtmltopdf.extend
Interface NamespaceHandler
-
- All Known Implementing Classes:
NoNamespaceHandler,XhtmlCssOnlyNamespaceHandler,XhtmlNamespaceHandler
public interface NamespaceHandlerProvides knowledge specific to a certain document type, like resolving style-sheets
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetAnchorName(org.w3c.dom.Element e)java.lang.StringgetAttributeValue(org.w3c.dom.Element e, java.lang.String attrName)may return null.java.lang.StringgetAttributeValue(org.w3c.dom.Element e, java.lang.String namespaceURI, java.lang.String attrName)java.lang.StringgetClass(org.w3c.dom.Element e)may return nullStylesheetInfogetDefaultStylesheet(StylesheetFactory factory)java.lang.StringgetDocumentTitle(org.w3c.dom.Document doc)java.lang.StringgetElementStyling(org.w3c.dom.Element e)may return nulljava.lang.StringgetID(org.w3c.dom.Element e)may return nulljava.lang.StringgetImageSourceURI(org.w3c.dom.Element e)For an element where isImageElement returns true, retrieves the URI associated with that Image, as reported by the element; makes no guarrantee that the URI is correct, complete or points to anything in particular.java.lang.StringgetLang(org.w3c.dom.Element e)may return nulljava.lang.StringgetLinkUri(org.w3c.dom.Element e)should return null if element is not a linkjava.lang.StringgetNamespace()java.lang.StringgetNonCssStyling(org.w3c.dom.Element e)may return nullStylesheetInfo[]getStylesheets(org.w3c.dom.Document doc)booleanisFormElement(org.w3c.dom.Element e)Determines whether or not the specified Element represents a <form>.booleanisImageElement(org.w3c.dom.Element e)
-
-
-
Method Detail
-
getNamespace
java.lang.String getNamespace()
- Returns:
- the namespace handled
-
getDefaultStylesheet
StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
- Returns:
- the default CSS stylesheet for this namespace
-
getDocumentTitle
java.lang.String getDocumentTitle(org.w3c.dom.Document doc)
- Parameters:
doc-- Returns:
- the title for this document, if any exists
-
getStylesheets
StylesheetInfo[] getStylesheets(org.w3c.dom.Document doc)
- Parameters:
doc-- Returns:
- all links to CSS stylesheets (type="text/css") in this document
-
getAttributeValue
java.lang.String getAttributeValue(org.w3c.dom.Element e, java.lang.String attrName)may return null. Required to return null if attribute does not exist and not null if attribute exists.- Parameters:
e- PARAMattrName- PARAM- Returns:
- The attributeValue value
-
getAttributeValue
java.lang.String getAttributeValue(org.w3c.dom.Element e, java.lang.String namespaceURI, java.lang.String attrName)
-
getClass
java.lang.String getClass(org.w3c.dom.Element e)
may return null- Parameters:
e- PARAM- Returns:
- The class value
-
getID
java.lang.String getID(org.w3c.dom.Element e)
may return null- Parameters:
e- PARAM- Returns:
- The iD value
-
getElementStyling
java.lang.String getElementStyling(org.w3c.dom.Element e)
may return null- Parameters:
e- PARAM- Returns:
- The elementStyling value (style attribute)
-
getNonCssStyling
java.lang.String getNonCssStyling(org.w3c.dom.Element e)
may return null- Parameters:
e-- Returns:
- The corresponding css properties for styling that is obtained in other ways.
-
getLang
java.lang.String getLang(org.w3c.dom.Element e)
may return null- Parameters:
e- PARAM- Returns:
- The lang value
-
getLinkUri
java.lang.String getLinkUri(org.w3c.dom.Element e)
should return null if element is not a link- Parameters:
e- PARAM- Returns:
- The linkUri value
-
getAnchorName
java.lang.String getAnchorName(org.w3c.dom.Element e)
- Parameters:
e-
-
isImageElement
boolean isImageElement(org.w3c.dom.Element e)
- Returns:
- Returns true if the Element represents an image.
-
isFormElement
boolean isFormElement(org.w3c.dom.Element e)
Determines whether or not the specified Element represents a <form>.- Parameters:
e- The Element to evaluate.- Returns:
- true if the Element is a <form> element, false otherwise.
-
getImageSourceURI
java.lang.String getImageSourceURI(org.w3c.dom.Element e)
For an element where isImageElement returns true, retrieves the URI associated with that Image, as reported by the element; makes no guarrantee that the URI is correct, complete or points to anything in particular. For elements whereisImageElement(org.w3c.dom.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.
-
-