Interface NamespaceHandler

All Known Implementing Classes:
NoNamespaceHandler, XhtmlCssOnlyNamespaceHandler, XhtmlNamespaceHandler

public interface NamespaceHandler
Provides knowledge specific to a certain document type, like resolving style-sheets
Author:
Torbjörn Gannholm
  • Method Details

    • getNamespace

      String getNamespace()
      Returns:
      the namespace handled
    • getDefaultStylesheet

      StylesheetInfo getDefaultStylesheet(StylesheetFactory factory)
      Returns:
      the default CSS stylesheet for this namespace
    • getDocumentTitle

      String getDocumentTitle(Document doc)
      Parameters:
      doc -
      Returns:
      the title for this document, if any exists
    • getStylesheets

      StylesheetInfo[] getStylesheets(Document doc)
      Parameters:
      doc -
      Returns:
      all links to CSS stylesheets (type="text/css") in this document
    • getAttributeValue

      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 - PARAM
      attrName - PARAM
      Returns:
      The attributeValue value
    • getAttributeValue

      String getAttributeValue(Element e, String namespaceURI, String attrName)
    • getClass

      String getClass(Element e)
      may return null
      Parameters:
      e - PARAM
      Returns:
      The class value
    • getID

      String getID(Element e)
      may return null
      Parameters:
      e - PARAM
      Returns:
      The iD value
    • getElementStyling

      String getElementStyling(Element e)
      may return null
      Parameters:
      e - PARAM
      Returns:
      The elementStyling value (style attribute)
    • getNonCssStyling

      String getNonCssStyling(Element e)
      may return null
      Parameters:
      e -
      Returns:
      The corresponding css properties for styling that is obtained in other ways.
    • getLang

      String getLang(Element e)
      may return null
      Parameters:
      e - PARAM
      Returns:
      The lang value
    • getLinkUri

      String getLinkUri(Element e)
      should return null if element is not a link
      Parameters:
      e - PARAM
      Returns:
      The linkUri value
    • getAnchorName

      String getAnchorName(Element e)
      Parameters:
      e -
    • isImageElement

      boolean isImageElement(Element e)
      Returns:
      Returns true if the Element represents an image.
    • isFormElement

      boolean isFormElement(Element e)
      Determines whether or not the specified Element represents a <form>.
      Parameters:
      e - The Element to evaluate.
      Returns:
      true if the Element is a <form> element, false otherwise.
    • getImageSourceURI

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