Class XhtmlCssOnlyNamespaceHandler

    • Field Detail

      • _namespace

        static final java.lang.String _namespace
        Description of the Field
        See Also:
        Constant Field Values
      • _defaultStylesheet

        private static StylesheetInfo _defaultStylesheet
      • _defaultStylesheetError

        private static boolean _defaultStylesheetError
      • _contentLanguageMetaValue

        private java.lang.String _contentLanguageMetaValue
    • Constructor Detail

      • XhtmlCssOnlyNamespaceHandler

        public XhtmlCssOnlyNamespaceHandler()
    • Method Detail

      • getClass

        public java.lang.String getClass​(org.w3c.dom.Element e)
        Gets the class attribute of the XhtmlNamespaceHandler object
        Specified by:
        getClass in interface NamespaceHandler
        Overrides:
        getClass in class NoNamespaceHandler
        Parameters:
        e - PARAM
        Returns:
        The class value
      • getID

        public java.lang.String getID​(org.w3c.dom.Element e)
        Gets the iD attribute of the XhtmlNamespaceHandler object
        Specified by:
        getID in interface NamespaceHandler
        Overrides:
        getID in class NoNamespaceHandler
        Parameters:
        e - PARAM
        Returns:
        The iD value
      • convertToLength

        protected java.lang.String convertToLength​(java.lang.String value)
      • isInteger

        protected boolean isInteger​(java.lang.String value)
      • getAttribute

        protected java.lang.String getAttribute​(org.w3c.dom.Element e,
                                                java.lang.String attrName)
      • readTextContent

        private static java.lang.String readTextContent​(org.w3c.dom.Element element)
      • collapseWhiteSpace

        private static java.lang.String collapseWhiteSpace​(java.lang.String text)
      • getLinkUri

        public java.lang.String getLinkUri​(org.w3c.dom.Element e)
        Gets the linkUri attribute of the XhtmlNamespaceHandler object
        Specified by:
        getLinkUri in interface NamespaceHandler
        Overrides:
        getLinkUri in class NoNamespaceHandler
        Parameters:
        e - PARAM
        Returns:
        The linkUri value
      • getDocumentTitle

        public java.lang.String getDocumentTitle​(org.w3c.dom.Document doc)
        Returns the title of the document as located in the contents of /html/head/title, or "" if none could be found.
        Specified by:
        getDocumentTitle in interface NamespaceHandler
        Overrides:
        getDocumentTitle in class NoNamespaceHandler
        Parameters:
        doc - the document to search for a title
        Returns:
        The document's title, or "" if none found
      • findFirstChild

        private org.w3c.dom.Element findFirstChild​(org.w3c.dom.Element parent,
                                                   java.lang.String targetName)
      • readStyleElement

        protected StylesheetInfo readStyleElement​(org.w3c.dom.Element style)
      • readLinkElement

        protected StylesheetInfo readLinkElement​(org.w3c.dom.Element link)
      • getDefaultStylesheetStream

        private java.io.InputStream getDefaultStylesheetStream()
      • getMetaInfo

        private java.util.Map<java.lang.String,​java.lang.String> getMetaInfo​(org.w3c.dom.Document doc)
      • getContentLanguageMetaTag

        private java.lang.String getContentLanguageMetaTag​(org.w3c.dom.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.
      • getLang

        public java.lang.String getLang​(org.w3c.dom.Element e)
        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.
        Specified by:
        getLang in interface NamespaceHandler
        Overrides:
        getLang in class NoNamespaceHandler
        Parameters:
        e - PARAM
        Returns:
        The lang value