com.gargoylesoftware.htmlunit.html
Interface ElementFactory

All Known Implementing Classes:
InputElementFactory, SvgElementFactory, UnknownElementFactory

public interface ElementFactory

Specification of a factory capable of creating HtmlElement objects.

Version:
$Revision: 7131 $
Author:
Christian Sell, Ahmed Ashour

Method Summary
 DomElement createElement(SgmlPage page, String tagName, Attributes attributes)
          Creates an element according to this factory's specification.
 DomElement createElementNS(SgmlPage page, String namespaceURI, String qualifiedName, Attributes attributes)
          Creates an element according to this factory's specification.
 DomElement createElementNS(SgmlPage page, String namespaceURI, String qualifiedName, Attributes attributes, boolean checkBrowserCompatibility)
          Creates an element according to this factory's specification.
 

Method Detail

createElement

DomElement createElement(SgmlPage page,
                         String tagName,
                         Attributes attributes)
Creates an element according to this factory's specification. Note that even though this method takes a page parameter, the element is not automatically added to the page's DOM tree.

Parameters:
page - the enclosing page for the new element
tagName - the tag name (most factories will be responsible for a specific tag, but this parameter is passed in for factories that don't follow this rule)
attributes - the attributes encountered during XML/HTML parsing (possibly null if no attributes specified
Returns:
the newly created and initialized element

createElementNS

DomElement createElementNS(SgmlPage page,
                           String namespaceURI,
                           String qualifiedName,
                           Attributes attributes)
Creates an element according to this factory's specification. Note that even though this method takes a page parameter, the element is not automatically added to the page's DOM tree.

Parameters:
page - the enclosing page for the new element
namespaceURI - the URI that identifies an XML namespace
qualifiedName - the qualified name of the element type to instantiate
attributes - the attributes encountered during XML/HTML parsing (possibly null if no attributes specified
Returns:
the newly created and initialized element

createElementNS

DomElement createElementNS(SgmlPage page,
                           String namespaceURI,
                           String qualifiedName,
                           Attributes attributes,
                           boolean checkBrowserCompatibility)
Creates an element according to this factory's specification. Note that even though this method takes a page parameter, the element is not automatically added to the page's DOM tree.

Parameters:
page - the enclosing page for the new element
namespaceURI - the URI that identifies an XML namespace
qualifiedName - the qualified name of the element type to instantiate
attributes - the attributes encountered during XML/HTML parsing (possibly null if no attributes specified
checkBrowserCompatibility - if true and the page doesn't support this element, return null
Returns:
the newly created and initialized element


Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.