jd.xml.xpath.model.build
Class ModelBuilderFactory

java.lang.Object
  extended byjd.xml.xpath.model.build.ModelBuilderFactory
Direct Known Subclasses:
NormalModelBuilderFactory

public abstract class ModelBuilderFactory
extends Object

A Factory class for ModelBuilder objects.


Field Summary
protected  String defaultModelName_
           
static String PROPERTY_NAME
           
 
Constructor Summary
ModelBuilderFactory()
           
 
Method Summary
abstract  boolean canBeUsedFor(XmlSource source)
          Test if a ModelBuilder created by this factory is suitable for documents denoted by the source.
abstract  ModelBuilder createModelBuilder()
          Create a ModelBuilder.
 XPathRootNode createTextNodeFragment(String text, NodeNamePool pool, int documentId)
          Create a text node fragment.
static ModelBuilderFactory getDefaultInstance()
          Return the default ModelBuilderFactory instance which is used if the global instance is not applicable for a given document source.
static ModelBuilderFactory getInstance()
          Return the global ModelBuilderFactory instance.
abstract  ModelBuilder getModelBuilder(ModelBuilder lastBuilder)
          Get a ModelBuilder.
static ModelBuilder getModelBuilder(XmlSource source, ModelBuilder lastBuilder)
          Get a ModelBuilder which is suitable for the given document source.
static void main(String[] args)
           
static void setInstance(ModelBuilderFactory instance)
          Set the global ModelBuilderFactory instance.
 void setProperties(String s)
          Set the factory dependent properties.
 void setProperty(String prop)
          Set a factory dependent property.
abstract  void setProperty(String key, String value)
          Set a factory dependent property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_NAME

public static final String PROPERTY_NAME
See Also:
Constant Field Values

defaultModelName_

protected String defaultModelName_
Constructor Detail

ModelBuilderFactory

public ModelBuilderFactory()
Method Detail

setInstance

public static void setInstance(ModelBuilderFactory instance)
Set the global ModelBuilderFactory instance.


getInstance

public static ModelBuilderFactory getInstance()
Return the global ModelBuilderFactory instance.


getDefaultInstance

public static ModelBuilderFactory getDefaultInstance()
Return the default ModelBuilderFactory instance which is used if the global instance is not applicable for a given document source.


getModelBuilder

public static ModelBuilder getModelBuilder(XmlSource source,
                                           ModelBuilder lastBuilder)
                                    throws XPathException
Get a ModelBuilder which is suitable for the given document source.

Parameters:
lastBuilder - an existing ModelBuilder instance which should be reused instead of creating a new builder of the same type. If null or not known to the factory a new builder will be created.
Throws:
XPathException

getModelBuilder

public abstract ModelBuilder getModelBuilder(ModelBuilder lastBuilder)
                                      throws XPathException
Get a ModelBuilder.

Parameters:
lastBuilder - an existing ModelBuilder instance which can should be reused instead of creating a new builder of the same type. If null or not known to the factory a new builder will be created.
Throws:
XPathException

canBeUsedFor

public abstract boolean canBeUsedFor(XmlSource source)
Test if a ModelBuilder created by this factory is suitable for documents denoted by the source.


createModelBuilder

public abstract ModelBuilder createModelBuilder()
                                         throws XPathException
Create a ModelBuilder.

Throws:
XPathException

createTextNodeFragment

public XPathRootNode createTextNodeFragment(String text,
                                            NodeNamePool pool,
                                            int documentId)
Create a text node fragment.


setProperties

public void setProperties(String s)
Set the factory dependent properties.


setProperty

public void setProperty(String prop)
Set a factory dependent property.


setProperty

public abstract void setProperty(String key,
                                 String value)
Set a factory dependent property.


main

public static void main(String[] args)