Top Description Methods
com.openhtmltopdf.extend

public Interface NamespaceHandler

Known Direct Implementers
com.openhtmltopdf.simple.NoNamespaceHandler
Imports
org.w3c.dom.Document, .Element, com.openhtmltopdf.css.extend.StylesheetFactory, com.openhtmltopdf.css.sheet.StylesheetInfo

Provides knowledge specific to a certain document type, like resolving style-sheets
Author
Torbjoern Gannholm

Method Summary

Modifier and TypeMethod and Description
public String
public String

Returns:

The attributeValue value
getAttributeValue
(Element
PARAM
e
,
String
PARAM
attrName
)

may return null.

public String
getAttributeValue(Element e, String namespaceURI, String attrName)

public String

Returns:

The class value
getClass
(Element
PARAM
e
)

may return null

public StylesheetInfo

Returns:

the default CSS stylesheet for this namespace
getDefaultStylesheet
(StylesheetFactory factory)

public String

Returns:

the title for this document, if any exists
getDocumentTitle
(Document doc)

public String

Returns:

The elementStyling value (style attribute)
getElementStyling
(Element
PARAM
e
)

may return null

public String

Returns:

The iD value
getID
(Element
PARAM
e
)

may return null

public String

Returns:

String containing the URI for the image.
getImageSourceURI
(Element
The element to extract image info from.
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.

public String

Returns:

The lang value
getLang
(Element
PARAM
e
)

may return null

public String

Returns:

The linkUri value
getLinkUri
(Element
PARAM
e
)

should return null if element is not a link

public String

Returns:

the namespace handled
getNamespace
()

public String

Returns:

The corresponding css properties for styling that is obtained in other ways.
getNonCssStyling
(Element e)

may return null

public StylesheetInfo[]

Returns:

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

public boolean

Returns:

true if the Element is a <form> element, false otherwise.
isFormElement
(Element
The Element to evaluate.
e
)

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

public boolean

Returns:

Returns true if the Element represents an image.
isImageElement
(Element e)

Method Detail

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

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)
getClassback to summary
public String getClass(Element e)

may return null

Parameters
e:Element

PARAM

Returns:String

The class value

getDefaultStylesheetback to summary
public StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
Returns:StylesheetInfo

the default CSS stylesheet for this namespace

getDocumentTitleback to summary
public String getDocumentTitle(Document doc)
Returns:String

the title for this document, if any exists

getElementStylingback to summary
public String getElementStyling(Element e)

may return null

Parameters
e:Element

PARAM

Returns:String

The elementStyling value (style attribute)

getIDback to summary
public String getID(Element e)

may return null

Parameters
e:Element

PARAM

Returns:String

The iD value

getImageSourceURIback to summary
public String getImageSourceURI(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 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)

may return null

Parameters
e:Element

PARAM

Returns:String

The lang value

getLinkUriback to summary
public String getLinkUri(Element e)

should return null if element is not a link

Parameters
e:Element

PARAM

Returns:String

The linkUri value

getNamespaceback to summary
public String getNamespace()
Returns:String

the namespace handled

getNonCssStylingback to summary
public String getNonCssStyling(Element e)

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)
Returns:StylesheetInfo[]

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

isFormElementback to summary
public boolean isFormElement(Element e)

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)
Returns:boolean

Returns true if the Element represents an image.