public abstract class CreateOMElementVariant extends Object
Modifier and Type | Field and Description |
---|---|
static CreateOMElementVariant[] |
INSTANCES |
Constructor and Description |
---|
CreateOMElementVariant(String name,
boolean supportsDefaultNamespace,
boolean supportsContainer) |
Modifier and Type | Method and Description |
---|---|
abstract OMElement |
createOMElement(OMFactory factory,
OMContainer parent,
String localName,
String namespaceURI,
String prefix)
Create an
OMElement . |
String |
getName() |
boolean |
isSupportsContainer()
Determines whether this strategy can be used to create an
OMElement as a child of
another container. |
boolean |
isSupportsDefaultNamespace()
Determines whether this strategy can be used to create an
OMElement in the default
namespace, i.e. |
public static final CreateOMElementVariant[] INSTANCES
public CreateOMElementVariant(String name, boolean supportsDefaultNamespace, boolean supportsContainer)
public final String getName()
public final boolean isSupportsDefaultNamespace()
OMElement
in the default
namespace, i.e. with an empty prefix.true
if the strategy supports default namespaces, false
otherwisepublic final boolean isSupportsContainer()
OMElement
as a child of
another container.true
if a OMContainer
object can be passed to
createOMElement(OMFactory, OMContainer, String, String, String)
public abstract OMElement createOMElement(OMFactory factory, OMContainer parent, String localName, String namespaceURI, String prefix)
OMElement
.factory
- the factory used to create the elementparent
- the parent of the element to be created or null
to create an orphaned
element; this parameter can only be used if isSupportsContainer()
returns
true
localName
- the local name of the elementnamespaceURI
- the namespace URI of the elementprefix
- the prefix of the element, the empty string if the element is to be created in the
default namespace (only supported if isSupportsDefaultNamespace()
returns
true
), or null
if a prefix should be generated or chosen
based on the namespace context of the parentCopyright © 2004–2019 The Apache Software Foundation. All rights reserved.