com.softwareag.tamino.db.api.objectModel
Class TXMLObjectFactory

java.lang.Object
  extended by com.softwareag.tamino.db.api.objectModel.TXMLObjectFactory

public final class TXMLObjectFactory
extends java.lang.Object

TXMLObjectFactory is the base class factory for the instantiation of concrete TXMLObject classes. This class provides DOM and JDOM as concrete object models. The support of other object models is possible by implementing further TXMLObjectFactory classes that are responsible for the instantiation of the appropiate object model adapter classes for TXMLObject. These concrete factories can be chosen thru the System property "com.softwareag.tamino.db.api.objectModel.TXMLObjectFactory" which has to point to the concrete class. If this is omitted this class simply serves as the default factory.

Version:
$Revision: 1.24 $
Author:
Marcus Schreyer

Constructor Summary
protected TXMLObjectFactory()
          Protected Constructor.
 
Method Summary
static TXMLObjectFactory getInstance()
          Gets the singleton instance.
 TXMLObject newXMLObject(java.io.InputStream inputStream)
          Creates a TXMLObject instance with an underlying input stream.
 TXMLObject newXMLObject(java.io.InputStream inputStream, java.util.Locale locale)
          Creates a TXMLObject instance with an underlying input stream.
 TXMLObject newXMLObject(java.io.InputStream inputStream, java.lang.String systemId)
          Creates a TXMLObject instance with an underlying input stream.
 TXMLObject newXMLObject(java.io.InputStream inputStream, java.lang.String systemId, java.util.Locale locale)
          Creates a TXMLObject instance with an underlying input stream.
 TXMLObject newXMLObject(java.lang.Object element)
          Factory method.
 TXMLObject newXMLObject(java.lang.Object element, java.util.Locale locale)
          Factory method.
 TXMLObject newXMLObject(java.io.Reader reader)
          Creates a TXMLObject instance with an underlying character input stream.
 TXMLObject newXMLObject(java.io.Reader reader, java.util.Locale locale)
          Creates a TXMLObject instance with an underlying character input stream.
 TXMLObject newXMLObject(java.io.Reader reader, java.lang.String systemId)
          Creates a TXMLObject instance with an underlying character input stream.
 TXMLObject newXMLObject(java.io.Reader reader, java.lang.String systemId, java.util.Locale locale)
          Creates a TXMLObject instance with an underlying character input stream.
 TXMLObject newXMLObject(TXMLObjectModel xmlObjectModel)
          Factory method.
 TXMLObject newXMLObject(TXMLObjectModel xmlObjectModel, java.util.Locale locale)
          Factory method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TXMLObjectFactory

protected TXMLObjectFactory()
Protected Constructor.

Method Detail

getInstance

public static TXMLObjectFactory getInstance()
Gets the singleton instance.


newXMLObject

public TXMLObject newXMLObject(TXMLObjectModel xmlObjectModel)
Factory method. Creates an empty TXMLObject instance for the given object model. The instance does not contain any XML specific content but can subsequently be used to instantiate its internal object model by using the readFrom services offered by the implemented TStreamable interface. Example:
          TXMLObject xmlObject = TXMLObject.newInstance( TDOMObjectModel.getInstance() , null , null );
                xmlObject.readFrom( inputStream );
                org.w3c.dom.Element rootElement = (org.w3c.dom.Element)xmlObject.getElement();
 

Parameters:
xmlObjectModel - specifies the concrete object model that should be used.
Returns:
TXMLObject that does not contain XML data but only the information of the specified object model.

newXMLObject

public TXMLObject newXMLObject(TXMLObjectModel xmlObjectModel,
                               java.util.Locale locale)
Factory method. Creates an empty TXMLObject instance for the given object model. The instance does not contain any XML specific content but can subsequently be used to instantiate its internal object model by using the readFrom services offered by the implemented TStreamable interface. Example:
   TXMLObject xmlObject = TXMLObject.newInstance( TDOMObjectModel.getInstance() , null , null );
     xmlObject.readFrom( inputStream );
     org.w3c.dom.Element rootElement = (org.w3c.dom.Element)xmlObject.getElement();
 

Parameters:
xmlObjectModel - specifies the concrete object model that should be used.
Returns:
TXMLObject that does not contain XML data but only the information of the specified object model.

newXMLObject

public TXMLObject newXMLObject(java.lang.Object element)
Factory method. Creates a TXMLObject from the given element instance. The adapter class is chosen automatically and the resulting TXMLObject wraps the given element object.

Parameters:
element - is the concrete object representing the XML document which is wrapped by the TXMLObject adapter.
Returns:
TXMLObject that wraps the given node object.

newXMLObject

public TXMLObject newXMLObject(java.lang.Object element,
                               java.util.Locale locale)
Factory method. Creates a TXMLObject from the given element instance. The adapter class is chosen automatically and the resulting TXMLObject wraps the given element object.

Parameters:
element - is the concrete object representing the XML document which is wrapped by the TXMLObject adapter.
Returns:
TXMLObject that wraps the given node object.

newXMLObject

public TXMLObject newXMLObject(java.io.InputStream inputStream)
Creates a TXMLObject instance with an underlying input stream. For this case a default SAX based object model is choses.

Parameters:
inputStream - is the byte input stream for XML data.
Returns:
the instantiated TXMLObject instance with an underlying input stream.

newXMLObject

public TXMLObject newXMLObject(java.io.InputStream inputStream,
                               java.util.Locale locale)
Creates a TXMLObject instance with an underlying input stream. For this case a default SAX based object model is choses.

Parameters:
inputStream - is the byte input stream for XML data.
Returns:
the instantiated TXMLObject instance with an underlying input stream.

newXMLObject

public TXMLObject newXMLObject(java.io.InputStream inputStream,
                               java.lang.String systemId)
Creates a TXMLObject instance with an underlying input stream. For this case a default SAX based object model is choses.

Parameters:
inputStream - is the byte input stream for XML data.
systemId - the base URI of the data to resolve relative references.
Returns:
the instantiated TXMLObject instance with an underlying input stream.

newXMLObject

public TXMLObject newXMLObject(java.io.InputStream inputStream,
                               java.lang.String systemId,
                               java.util.Locale locale)
Creates a TXMLObject instance with an underlying input stream. For this case a default SAX based object model is choses.

Parameters:
inputStream - is the byte input stream for XML data.
systemId - the base URI of the data to resolve relative references.
Returns:
the instantiated TXMLObject instance with an underlying input stream.

newXMLObject

public TXMLObject newXMLObject(java.io.Reader reader)
Creates a TXMLObject instance with an underlying character input stream. For this case a default SAX based object model is choses.

Parameters:
reader - is the character input stream for XML data.
Returns:
the instantiated TXMLObject instance with an underlying input stream.

newXMLObject

public TXMLObject newXMLObject(java.io.Reader reader,
                               java.util.Locale locale)
Creates a TXMLObject instance with an underlying character input stream. For this case a default SAX based object model is choses.

Parameters:
reader - is the character input stream for XML data.
Returns:
the instantiated TXMLObject instance with an underlying input stream.

newXMLObject

public TXMLObject newXMLObject(java.io.Reader reader,
                               java.lang.String systemId)
Creates a TXMLObject instance with an underlying character input stream. For this case a default SAX based object model is choses.

Parameters:
reader - is the character input stream for XML data.
systemId - the base URI of the data to resolve relative references.
Returns:
the instantiated TXMLObject instance with an underlying input stream.

newXMLObject

public TXMLObject newXMLObject(java.io.Reader reader,
                               java.lang.String systemId,
                               java.util.Locale locale)
Creates a TXMLObject instance with an underlying character input stream. For this case a default SAX based object model is choses.

Parameters:
reader - is the character input stream for XML data.
systemId - the base URI of the data to resolve relative references.
Returns:
the instantiated TXMLObject instance with an underlying input stream.


Copyright (c) 2013 Software AG. All Rights Reserved.