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

public Class XhtmlCssOnlyNamespaceHandler

extends NoNamespaceHandler
Class Inheritance
Known Direct Subclasses
com.openhtmltopdf.simple.extend.XhtmlNamespaceHandler
Imports
java.io.IOException, .InputStream, .InputStreamReader, java.util.ArrayList, .Arrays, .HashMap, .List, .Map, java.util.logging.Level, com.openhtmltopdf.util.LogMessageId, .Configuration, .XRLog, org.w3c.dom.CharacterData, .Element, .Node, .NodeList, .Text, com.openhtmltopdf.css.extend.StylesheetFactory, com.openhtmltopdf.css.sheet.Stylesheet, .StylesheetInfo, com.openhtmltopdf.simple.NoNamespaceHandler

Handles xhtml but only css styling is honored, no presentational html attributes (see css 2.1 spec, 6.4.4)

Field Summary

Modifier and TypeField and Description
private String
private static StylesheetInfo
private static boolean
pack-priv static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static String
protected String
private Element
findFirstChild(Element parent, String targetName)

public String
protected String
public String

Returns:

The class value
getClass
(Element
PARAM
e
)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getClass.

Implements com.openhtmltopdf.extend.NamespaceHandler.getClass.

Gets the class attribute of the XhtmlNamespaceHandler object

private String
getContentLanguageMetaTag(Document doc)

Get the Content-Language meta tag value from the head section of the doc or the empty string.

public StylesheetInfo
private InputStream
public String

Returns:

The document's title, or "" if none found
getDocumentTitle
(Document
the document to search for a title
doc
)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getDocumentTitle.

Implements com.openhtmltopdf.extend.NamespaceHandler.getDocumentTitle.

Returns the title of the document as located in the contents of /html/head/title, or "" if none could be found.

public String

Returns:

The elementStyling value
getElementStyling
(Element
PARAM
e
)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getElementStyling.

Implements com.openhtmltopdf.extend.NamespaceHandler.getElementStyling.

Gets the elementStyling attribute of the XhtmlNamespaceHandler object

public String

Returns:

The iD value
getID
(Element
PARAM
e
)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getID.

Implements com.openhtmltopdf.extend.NamespaceHandler.getID.

Gets the iD attribute of the XhtmlNamespaceHandler object

public String
getLang(Element
PARAM
e
)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getLang.

Implements com.openhtmltopdf.extend.NamespaceHandler.getLang.

Gets the language of an element as specified (in order of precedence) by the lang attribute on the element itself, the first ancestor with a lang attribute, the Content-Language meta tag or the empty string.

public String

Returns:

The linkUri value
getLinkUri
(Element
PARAM
e
)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getLinkUri.

Implements com.openhtmltopdf.extend.NamespaceHandler.getLinkUri.

Gets the linkUri attribute of the XhtmlNamespaceHandler object

private Map<String, String>
public String

Returns:

The namespace value
getNamespace
()

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getNamespace.

Implements com.openhtmltopdf.extend.NamespaceHandler.getNamespace.

Gets the namespace attribute of the XhtmlNamespaceHandler object

public StylesheetInfo[]

Returns:

The stylesheetLinks value
getStylesheets
(Document
PARAM
doc
)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getStylesheets.

Implements com.openhtmltopdf.extend.NamespaceHandler.getStylesheets.

Gets the stylesheetLinks attribute of the XhtmlNamespaceHandler object

protected boolean
protected StylesheetInfo
protected StylesheetInfo
private static String
Inherited from com.openhtmltopdf.simple.NoNamespaceHandler:
getAttributeValuegetAttributeValuegetImageSourceURIgetNonCssStylingisFormElementisImageElement

Field Detail

_contentLanguageMetaValueback to summary
private String _contentLanguageMetaValue
_defaultStylesheetback to summary
private static StylesheetInfo _defaultStylesheet
_defaultStylesheetErrorback to summary
private static boolean _defaultStylesheetError
_namespaceback to summary
pack-priv static final String _namespace

Hides com.openhtmltopdf.simple.NoNamespaceHandler._namespace.

Description of the Field

Constructor Detail

XhtmlCssOnlyNamespaceHandlerback to summary
public XhtmlCssOnlyNamespaceHandler()

Method Detail

collapseWhiteSpaceback to summary
private static String collapseWhiteSpace(String text)
convertToLengthback to summary
protected String convertToLength(String value)
findFirstChildback to summary
private Element findFirstChild(Element parent, String targetName)
getAnchorNameback to summary
public String getAnchorName(Element e)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getAnchorName.

Implements com.openhtmltopdf.extend.NamespaceHandler.getAnchorName.

getAttributeback to summary
protected String getAttribute(Element e, String attrName)
getClassback to summary
public String getClass(Element e)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getClass.

Implements com.openhtmltopdf.extend.NamespaceHandler.getClass.

Gets the class attribute of the XhtmlNamespaceHandler object

Parameters
e:Element

PARAM

Returns:String

The class value

getContentLanguageMetaTagback to summary
private String getContentLanguageMetaTag(Document doc)

Get the Content-Language meta tag value from the head section of the doc or the empty string. Caches value so can be called multiple times without performance issues.

getDefaultStylesheetback to summary
public StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getDefaultStylesheet.

Implements com.openhtmltopdf.extend.NamespaceHandler.getDefaultStylesheet.

Returns:StylesheetInfo

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

the default CSS stylesheet for this namespace

getDefaultStylesheetStreamback to summary
private InputStream getDefaultStylesheetStream()
getDocumentTitleback to summary
public String getDocumentTitle(Document doc)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getDocumentTitle.

Implements com.openhtmltopdf.extend.NamespaceHandler.getDocumentTitle.

Returns the title of the document as located in the contents of /html/head/title, or "" if none could be found.

Parameters
doc:Document

the document to search for a title

Returns:String

The document's title, or "" if none found

getElementStylingback to summary
public String getElementStyling(Element e)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getElementStyling.

Implements com.openhtmltopdf.extend.NamespaceHandler.getElementStyling.

Gets the elementStyling attribute of the XhtmlNamespaceHandler object

Parameters
e:Element

PARAM

Returns:String

The elementStyling value

getIDback to summary
public String getID(Element e)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getID.

Implements com.openhtmltopdf.extend.NamespaceHandler.getID.

Gets the iD attribute of the XhtmlNamespaceHandler object

Parameters
e:Element

PARAM

Returns:String

The iD value

getLangback to summary
public String getLang(Element e)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getLang.

Implements com.openhtmltopdf.extend.NamespaceHandler.getLang.

Gets the language of an element as specified (in order of precedence) by the lang attribute on the element itself, the first ancestor with a lang attribute, the Content-Language meta tag or the empty string.

Parameters
e:Element

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

PARAM

Returns:String

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

The lang value

getLinkUriback to summary
public String getLinkUri(Element e)

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getLinkUri.

Implements com.openhtmltopdf.extend.NamespaceHandler.getLinkUri.

Gets the linkUri attribute of the XhtmlNamespaceHandler object

Parameters
e:Element

PARAM

Returns:String

The linkUri value

getMetaInfoback to summary
private Map<String, String> getMetaInfo(Document doc)
getNamespaceback to summary
public String getNamespace()

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getNamespace.

Implements com.openhtmltopdf.extend.NamespaceHandler.getNamespace.

Gets the namespace attribute of the XhtmlNamespaceHandler object

Returns:String

The namespace value

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

Overrides com.openhtmltopdf.simple.NoNamespaceHandler.getStylesheets.

Implements com.openhtmltopdf.extend.NamespaceHandler.getStylesheets.

Gets the stylesheetLinks attribute of the XhtmlNamespaceHandler object

Parameters
doc:Document

PARAM

Returns:StylesheetInfo[]

The stylesheetLinks value

isIntegerback to summary
protected boolean isInteger(String value)
readLinkElementback to summary
protected StylesheetInfo readLinkElement(Element link)
readStyleElementback to summary
protected StylesheetInfo readStyleElement(Element style)
readTextContentback to summary
private static String readTextContent(Element element)