org.apache.axiom.ts.om.factory
Class CreateOMElementVariant

java.lang.Object
  extended by org.apache.axiom.ts.om.factory.CreateOMElementVariant

public abstract class CreateOMElementVariant
extends Object


Field Summary
static CreateOMElementVariant[] INSTANCES
           
 
Constructor Summary
CreateOMElementVariant(String name, boolean supportsDefaultNamespace, boolean supportsContainer)
           
 
Method Summary
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. with an empty prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCES

public static final CreateOMElementVariant[] INSTANCES
Constructor Detail

CreateOMElementVariant

public CreateOMElementVariant(String name,
                              boolean supportsDefaultNamespace,
                              boolean supportsContainer)
Method Detail

getName

public final String getName()

isSupportsDefaultNamespace

public final boolean isSupportsDefaultNamespace()
Determines whether this strategy can be used to create an OMElement in the default namespace, i.e. with an empty prefix.

Returns:
true if the strategy supports default namespaces, false otherwise

isSupportsContainer

public final boolean isSupportsContainer()
Determines whether this strategy can be used to create an OMElement as a child of another container.

Returns:
true if a OMContainer object can be passed to createOMElement(OMFactory, OMContainer, String, String, String)

createOMElement

public abstract OMElement createOMElement(OMFactory factory,
                                          OMContainer parent,
                                          String localName,
                                          String namespaceURI,
                                          String prefix)
Create an OMElement.

Parameters:
factory - the factory used to create the element
parent - 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 element
namespaceURI - the namespace URI of the element
prefix - 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 parent
Returns:
the created element


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.