net.sf.fikin.ant.types
Class FactoryLiaison

java.lang.Object
  extended by net.sf.fikin.ant.types.FactoryLiaison
Direct Known Subclasses:
XPathFactoryLiaison

public abstract class FactoryLiaison
extends java.lang.Object

A generic type of JAXP type of factory

Contains ability to instnatiate factory class explicitly

Allows to set features/attributes to it, event ot default one created on Jan 3, 2007

Since:
Version:
$Revision: 1.3 $
Author:
fiykov

Constructor Summary
FactoryLiaison()
           
 
Method Summary
 java.lang.Object getFactory()
          instantiate a new factory if needed
protected abstract  java.lang.Object newFactory()
          create new default factory instance
protected  java.lang.Object newFactory(java.lang.String fqclassname)
          instantiate new factory from given classname
protected abstract  void setAttribute(java.lang.Object factory, Parameter param)
          set a single attribute to the factory
protected  void setAttributes(java.lang.Object factory, java.util.Vector attrs)
          set all attirbutes to the factory
 void setFactoryType(FactoryType factoryType)
          assign factory type object used to identify the actual factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryLiaison

public FactoryLiaison()
Method Detail

setFactoryType

public void setFactoryType(FactoryType factoryType)
assign factory type object used to identify the actual factory

Parameters:
factoryType -

getFactory

public java.lang.Object getFactory()
instantiate a new factory if needed

Returns:
factory to be used

newFactory

protected abstract java.lang.Object newFactory()
                                        throws org.apache.tools.ant.BuildException
create new default factory instance

Returns:
new default factory
Throws:
org.apache.tools.ant.BuildException

newFactory

protected java.lang.Object newFactory(java.lang.String fqclassname)
                               throws org.apache.tools.ant.BuildException
instantiate new factory from given classname

uses Class.findClass() and Class.newInstance() to create it

This presumes all factories are simply instantiated

Parameters:
fqclassname -
Returns:
new factory
Throws:
org.apache.tools.ant.BuildException

setAttributes

protected void setAttributes(java.lang.Object factory,
                             java.util.Vector attrs)
set all attirbutes to the factory

Parameters:
factory -
attrs -

setAttribute

protected abstract void setAttribute(java.lang.Object factory,
                                     Parameter param)
                              throws org.apache.tools.ant.BuildException
set a single attribute to the factory

Parameters:
factory -
param -
Throws:
org.apache.tools.ant.BuildException


Copyright © 2003-2007 Nikolay Fiykov. All Rights Reserved.