Top Description Fields Constructors Methods
com.openhtmltopdf.simple.extend

public Class XhtmlNamespaceHandler

extends XhtmlCssOnlyNamespaceHandler
Class Inheritance
Imports
java.util.logging.Level, com.openhtmltopdf.util.LogMessageId, .XRLog, org.w3c.dom.Element, .Node

Handles xhtml documents, including presentational html attributes (see css 2.1 spec, 6.4.4). In this class ONLY handling (css equivalents) of presentational properties (according to css 2.1 spec, section 6.4.4) should be specified.
Author
Torbjoern Gannholm

Field Summary

Modifier and TypeField and Description
private static final String
Inherited from com.openhtmltopdf.simple.extend.XhtmlCssOnlyNamespaceHandler:
_namespace

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getImageSourceURI.

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 boolean
isFormElement(Element
The Element to evaluate.
e
)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.isFormElement.

Implements com.openhtmltopdf.extend.NamespaceHandler.isFormElement.

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

public boolean
private boolean
Inherited from com.openhtmltopdf.simple.extend.XhtmlCssOnlyNamespaceHandler:
convertToLengthgetAnchorNamegetAttributegetClassgetDefaultStylesheetgetDocumentTitlegetElementStylinggetIDgetLanggetLinkUrigetNamespacegetStylesheetsisIntegerreadLinkElementreadStyleElement

Field Detail

DEFAULT_SVG_DIMSback to summary
private static final String DEFAULT_SVG_DIMS

Constructor Detail

XhtmlNamespaceHandlerback to summary
public XhtmlNamespaceHandler()

Method Detail

applyBlockAlignback to summary
private String applyBlockAlign(Element e)
applyFloatingAlignback to summary
private void applyFloatingAlign(Element e, StringBuilder style)
applyImgStylesback to summary
private String applyImgStyles(Element e)
applyInputStylesback to summary
private String applyInputStyles(Element e)
applySvgStylesback to summary
private String applySvgStyles(Element e)
applyTableCellStylesback to summary
private String applyTableCellStyles(Element e)
applyTableContentAlignback to summary
private void applyTableContentAlign(Element e, StringBuilder style)
applyTableRowStylesback to summary
private String applyTableRowStyles(Element e)
applyTableStylesback to summary
private String applyTableStyles(Element e)
applyTextAlignback to summary
private void applyTextAlign(Element e, StringBuilder style)
applyTextareaStylesback to summary
private String applyTextareaStyles(Element e)
findTableback to summary
private Element findTable(Element cell)
getImageSourceURIback to summary
public String getImageSourceURI(Element e)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getImageSourceURI.

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.

getNonCssStylingback to summary
public String getNonCssStyling(Element e)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getNonCssStyling.

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.

isFormElementback to summary
public boolean isFormElement(Element e)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.isFormElement.

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)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.isImageElement.

Implements com.openhtmltopdf.extend.NamespaceHandler.isImageElement.

Returns:boolean

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

Returns true if the Element represents an image.

looksLikeAMangledColorback to summary
private boolean looksLikeAMangledColor(String s)