Logo Search packages:      
Sourcecode: jardiff version File versions  Download package

TransformerFactory org::osjava::jardiff::ant::JDTraXLiaison::getFactory (  )  throws BuildException [inline, private]

return the Transformer factory associated to this liaison.

Returns:
the Transformer factory associated to this liaison.
Exceptions:
BuildException thrown if there is a problem creating the factory.
See also:
setFactory(String)
Since:
Ant 1.5.2

Definition at line 318 of file JDTraXLiaison.java.

References attributes, factoryName, tfactory, and uriResolver.

Referenced by readTemplates().

                                                                  {
        if (tfactory != null) {
            return tfactory;
        }
        // not initialized yet, so create the factory
        if (factoryName == null) {
            tfactory = TransformerFactory.newInstance();
        } else {
            try {
                Class clazz = Class.forName(factoryName);
                tfactory = (TransformerFactory) clazz.newInstance();
            } catch (Exception e) {
                throw new BuildException(e);
            }
        }
        tfactory.setErrorListener(this);

        // specific attributes for the transformer
        for (int i = 0; i < attributes.size(); i++) {
            final Object[] pair = (Object[]) attributes.elementAt(i);
            tfactory.setAttribute((String) pair[0], pair[1]);
        }

        if (uriResolver != null) {
            tfactory.setURIResolver(uriResolver);
        }
        return tfactory;
    }


Generated by  Doxygen 1.6.0   Back to index