Package org.htmlunit.html

# Class UnknownElementFactory

java.lang.Object
org.htmlunit.html.UnknownElementFactory

All Implemented Interfaces:
  `ElementFactory`

public final class UnknownElementFactory extends Object implements ElementFactory
A factory for elements encountered in parsing the input which are not represented by dedicated element classes.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final UnknownElementFactory`
  `INSTANCE`
  The singleton instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `HtmlElement`
  `createElement(SgmlPage page, String tagName, Attributes attributes)`
  Creates an element according to this factory's specification.
  `HtmlElement`
  `createElementNS(SgmlPage page, String namespaceURI, String qualifiedName, Attributes attributes)`
  Creates an element according to this factory's specification.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### INSTANCE

    public static final UnknownElementFactory INSTANCE
    The singleton instance.

- ## Method Details

  - ### createElement

    public HtmlElement 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.
    Specified by:
      `createElement` in interface `ElementFactory`
    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

    public HtmlElement 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.
    Specified by:
      `createElementNS` in interface `ElementFactory`
    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