Package org.htmlunit.svg
Class SvgElementFactory
java.lang.Object
org.htmlunit.svg.SvgElementFactory
- All Implemented Interfaces:
ElementFactory
Element factory which creates elements by calling the constructor on a
given
SvgElement
subclass.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateElement
(SgmlPage page, String tagName, Attributes attributes) Creates an element according to this factory's specification.createElementNS
(SgmlPage page, String namespaceURI, String qualifiedName, Attributes attributes) Creates an element according to this factory's specification.createElementNS
(SgmlPage page, String namespaceURI, String qualifiedNameLC, Attributes attributes, boolean checkBrowserCompatibility) Creates an element according to this factory's specification.boolean
isSupported
(String tagNameLowerCase) Returns whether the specified name is a valid SVG tag name.toMap
(SgmlPage page, Attributes attributes)
-
Field Details
-
CLASSES_
-
ELEMENTS_
-
-
Constructor Details
-
SvgElementFactory
public SvgElementFactory()
-
-
Method Details
-
createElement
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 interfaceElementFactory
- Parameters:
page
- the enclosing page for the new elementtagName
- 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 (possiblynull
if no attributes specified- Returns:
- the newly created and initialized element
-
createElementNS
public 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.- Specified by:
createElementNS
in interfaceElementFactory
- Parameters:
page
- the enclosing page for the new elementnamespaceURI
- the URI that identifies an XML namespacequalifiedName
- the qualified name of the element type to instantiateattributes
- the attributes encountered during XML/HTML parsing (possiblynull
if no attributes specified- Returns:
- the newly created and initialized element
-
createElementNS
public DomElement createElementNS(SgmlPage page, String namespaceURI, String qualifiedNameLC, 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.- Specified by:
createElementNS
in interfaceElementFactory
- Parameters:
page
- the enclosing page for the new elementnamespaceURI
- the URI that identifies an XML namespacequalifiedNameLC
- the qualified name of the element type to instantiateattributes
- the attributes encountered during XML/HTML parsing (possiblynull
if no attributes specifiedcheckBrowserCompatibility
- if true and the page doesn't support this element, return null- Returns:
- the newly created and initialized element
-
toMap
-
isSupported
Returns whether the specified name is a valid SVG tag name.- Parameters:
tagNameLowerCase
- the tag name in lower case- Returns:
- whether the specified name is a valid SVG tag name or not
-