Top Description Fields Constructors Methods
com.openhtmltopdf.simple

public Class NoNamespaceHandler

extends Object
implements NamespaceHandler
Class Inheritance
All Implemented Interfaces
com.openhtmltopdf.extend.NamespaceHandler
Known Direct Subclasses
com.openhtmltopdf.simple.extend.XhtmlCssOnlyNamespaceHandler
Imports
java.util.ArrayList, .List, java.util.regex.Matcher, .Pattern, org.w3c.dom.Attr, .Element, .NamedNodeMap, .Node, .NodeList, .ProcessingInstruction, com.openhtmltopdf.css.extend.StylesheetFactory, .TreeResolver, com.openhtmltopdf.css.sheet.StylesheetInfo, com.openhtmltopdf.extend.NamespaceHandler

Handles a general XML document
Author
Torbjoern Gannholm

Field Summary

Modifier and TypeField and Description
private Pattern
private Pattern
private Pattern
pack-priv static final String
private Pattern
private Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public String
public String
public String
public StylesheetInfo
public String
public String
public String
public String
getImageSourceURI(Element
The element to extract image info from.
e
)

Implements com.openhtmltopdf.extend.NamespaceHandler.getImageSourceURI.

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.

public String
public String
getLinkUri(Element
PARAM
e
)

Implements com.openhtmltopdf.extend.NamespaceHandler.getLinkUri.

should return null if element is not a link

public String
public String
public StylesheetInfo[]
public boolean
isFormElement(Element
The Element to evaluate.
e
)

Implements com.openhtmltopdf.extend.NamespaceHandler.isFormElement.

Determines whether or not the specified Element represents a <form>.

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_alternatePatternback to summary
private Pattern _alternatePattern
_hrefPatternback to summary
private Pattern _hrefPattern
_mediaPatternback to summary
private Pattern _mediaPattern
_namespaceback to summary
pack-priv static final String _namespace
_titlePatternback to summary
private Pattern _titlePattern
_typePatternback to summary
private Pattern _typePattern

Constructor Detail

NoNamespaceHandlerback to summary
public NoNamespaceHandler()

Method Detail

getAnchorNameback to summary
public String getAnchorName(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.getAnchorName.

getAttributeValueback to summary
public String getAttributeValue(Element e, String attrName)

Implements com.openhtmltopdf.extend.NamespaceHandler.getAttributeValue.

Doc from com.openhtmltopdf.extend.NamespaceHandler.getAttributeValue.

may return null. Required to return null if attribute does not exist and not null if attribute exists.

Parameters
e:Element

PARAM

attrName:String

PARAM

Returns:String

The attributeValue value

getAttributeValueback to summary
public String getAttributeValue(Element e, String namespaceURI, String attrName)

Implements com.openhtmltopdf.extend.NamespaceHandler.getAttributeValue.

getClassback to summary
public String getClass(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.getClass.

Doc from com.openhtmltopdf.extend.NamespaceHandler.getClass.

may return null

Parameters
e:Element

PARAM

Returns:String

The class value

getDefaultStylesheetback to summary
public StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)

Implements com.openhtmltopdf.extend.NamespaceHandler.getDefaultStylesheet.

Returns:StylesheetInfo

Doc from com.openhtmltopdf.extend.NamespaceHandler.getDefaultStylesheet.

the default CSS stylesheet for this namespace

getDocumentTitleback to summary
public String getDocumentTitle(Document doc)

Implements com.openhtmltopdf.extend.NamespaceHandler.getDocumentTitle.

Returns:String

Doc from com.openhtmltopdf.extend.NamespaceHandler.getDocumentTitle.

the title for this document, if any exists

getElementStylingback to summary
public String getElementStyling(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.getElementStyling.

Doc from com.openhtmltopdf.extend.NamespaceHandler.getElementStyling.

may return null

Parameters
e:Element

PARAM

Returns:String

The elementStyling value (style attribute)

getIDback to summary
public String getID(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.getID.

Doc from com.openhtmltopdf.extend.NamespaceHandler.getID.

may return null

Parameters
e:Element

PARAM

Returns:String

The iD value

getImageSourceURIback to summary
public String getImageSourceURI(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.getImageSourceURI.

Doc from com.openhtmltopdf.extend.NamespaceHandler.getImageSourceURI.

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 where 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.

Parameters
e:Element

The element to extract image info from.

Returns:String

String containing the URI for the image.

getLangback to summary
public String getLang(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.getLang.

Doc from com.openhtmltopdf.extend.NamespaceHandler.getLang.

may return null

Parameters
e:Element

PARAM

Returns:String

The lang value

getLinkUriback to summary
public String getLinkUri(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.getLinkUri.

Doc from com.openhtmltopdf.extend.NamespaceHandler.getLinkUri.

should return null if element is not a link

Parameters
e:Element

PARAM

Returns:String

The linkUri value

getNamespaceback to summary
public String getNamespace()

Implements com.openhtmltopdf.extend.NamespaceHandler.getNamespace.

Returns:String

Doc from com.openhtmltopdf.extend.NamespaceHandler.getNamespace.

the namespace handled

getNonCssStylingback to summary
public String getNonCssStyling(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.getNonCssStyling.

Doc from com.openhtmltopdf.extend.NamespaceHandler.getNonCssStyling.

may return null

Returns:String

The corresponding css properties for styling that is obtained in other ways.

getStylesheetsback to summary
public StylesheetInfo[] getStylesheets(Document doc)

Implements com.openhtmltopdf.extend.NamespaceHandler.getStylesheets.

Returns:StylesheetInfo[]

Doc from com.openhtmltopdf.extend.NamespaceHandler.getStylesheets.

all links to CSS stylesheets (type="text/css") in this document

isFormElementback to summary
public boolean isFormElement(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.isFormElement.

Doc from com.openhtmltopdf.extend.NamespaceHandler.isFormElement.

Determines whether or not the specified Element represents a <form>.

Parameters
e:Element

The Element to evaluate.

Returns:boolean

true if the Element is a <form> element, false otherwise.

isImageElementback to summary
public boolean isImageElement(Element e)

Implements com.openhtmltopdf.extend.NamespaceHandler.isImageElement.

Returns:boolean

Doc from com.openhtmltopdf.extend.NamespaceHandler.isImageElement.

Returns true if the Element represents an image.