Package com.openhtmltopdf.simple
Class NoNamespaceHandler
- java.lang.Object
-
- com.openhtmltopdf.simple.NoNamespaceHandler
-
- All Implemented Interfaces:
NamespaceHandler
- Direct Known Subclasses:
XhtmlCssOnlyNamespaceHandler
public class NoNamespaceHandler extends Object implements NamespaceHandler
Handles a general XML document- Author:
- Torbjoern Gannholm
-
-
Constructor Summary
Constructors Constructor Description NoNamespaceHandler()
-
Method Summary
All Methods Instance Methods Concrete 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)may return nullStylesheetInfogetDefaultStylesheet(StylesheetFactory factory)StringgetDocumentTitle(Document doc)StringgetElementStyling(Element e)may return nullStringgetID(Element e)may return nullStringgetImageSourceURI(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.StringgetLang(Element e)may return nullStringgetLinkUri(Element e)should return null if element is not a linkStringgetNamespace()StringgetNonCssStyling(Element e)may return nullStylesheetInfo[]getStylesheets(Document doc)booleanisFormElement(Element e)Determines whether or not the specified Element represents a <form>.booleanisImageElement(Element e)
-
-
-
Method Detail
-
getNamespace
public String getNamespace()
- Specified by:
getNamespacein interfaceNamespaceHandler- Returns:
- the namespace handled
-
getAttributeValue
public String getAttributeValue(Element e, String attrName)
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- Parameters:
e- PARAMattrName- PARAM- Returns:
- The attributeValue value
-
getAttributeValue
public String getAttributeValue(Element e, String namespaceURI, String attrName)
- Specified by:
getAttributeValuein interfaceNamespaceHandler
-
getClass
public String getClass(Element e)
Description copied from interface:NamespaceHandlermay return null- Specified by:
getClassin interfaceNamespaceHandler- Parameters:
e- PARAM- Returns:
- The class value
-
getID
public String getID(Element e)
Description copied from interface:NamespaceHandlermay return null- Specified by:
getIDin interfaceNamespaceHandler- Parameters:
e- PARAM- Returns:
- The iD value
-
getLang
public String getLang(Element e)
Description copied from interface:NamespaceHandlermay return null- Specified by:
getLangin interfaceNamespaceHandler- Parameters:
e- PARAM- Returns:
- The lang value
-
getElementStyling
public String getElementStyling(Element e)
Description copied from interface:NamespaceHandlermay return null- Specified by:
getElementStylingin interfaceNamespaceHandler- Parameters:
e- PARAM- Returns:
- The elementStyling value (style attribute)
-
getNonCssStyling
public String getNonCssStyling(Element e)
Description copied from interface:NamespaceHandlermay return null- Specified by:
getNonCssStylingin interfaceNamespaceHandler- Returns:
- The corresponding css properties for styling that is obtained in other ways.
-
getLinkUri
public String getLinkUri(Element e)
Description copied from interface:NamespaceHandlershould return null if element is not a link- Specified by:
getLinkUriin interfaceNamespaceHandler- Parameters:
e- PARAM- Returns:
- The linkUri value
-
getDocumentTitle
public String getDocumentTitle(Document doc)
- Specified by:
getDocumentTitlein interfaceNamespaceHandler- Returns:
- the title for this document, if any exists
-
getAnchorName
public String getAnchorName(Element e)
- Specified by:
getAnchorNamein interfaceNamespaceHandler
-
isImageElement
public boolean isImageElement(Element e)
- Specified by:
isImageElementin interfaceNamespaceHandler- Returns:
- Returns true if the Element represents an image.
-
getImageSourceURI
public String getImageSourceURI(Element e)
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 guarrantee that the URI is correct, complete or points to anything in particular. For elements whereNamespaceHandler.isImageElement(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.- Specified by:
getImageSourceURIin interfaceNamespaceHandler- Parameters:
e- The element to extract image info from.- Returns:
- String containing the URI for the image.
-
isFormElement
public boolean isFormElement(Element e)
Description copied from interface:NamespaceHandlerDetermines whether or not 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
public StylesheetInfo[] getStylesheets(Document doc)
- Specified by:
getStylesheetsin interfaceNamespaceHandler- Returns:
- all links to CSS stylesheets (type="text/css") in this document
-
getDefaultStylesheet
public StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
- Specified by:
getDefaultStylesheetin interfaceNamespaceHandler- Returns:
- the default CSS stylesheet for this namespace
-
-