net.sf.fikin.ant.types
Class XMLInput

java.lang.Object
  extended by net.sf.fikin.ant.types.Input
      extended by net.sf.fikin.ant.types.XMLInput
All Implemented Interfaces:
Type
Direct Known Subclasses:
XHTMLInput

public class XMLInput
extends Input

Support retrieval of an input XML document as DOM tree

Provides with customization of the DOM facotry created on Jan 3, 2007

Since:
Version:
$Revision: 1.2 $
Author:
fiykov

Constructor Summary
XMLInput()
           
 
Method Summary
 org.w3c.dom.Document getDocument(org.apache.tools.ant.Task task)
          get the input as a DOM tree
protected  javax.xml.parsers.DocumentBuilderFactory getFactory()
          obtain a reference to the DOM factory
protected  void setFactorySettings(javax.xml.parsers.DocumentBuilderFactory factory)
          set internal properties of the DOM facotry before creating a builder
 void setNamespaceAware(boolean flg)
          set if DOM factory to be namespace aware
 
Methods inherited from class net.sf.fikin.ant.types.Input
addText, check, getInputStream, getReader, setFile, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLInput

public XMLInput()
Method Detail

setNamespaceAware

public void setNamespaceAware(boolean flg)
set if DOM factory to be namespace aware

Parameters:
flg - when true DOM facotry will be namespace aware,

by default true

Ant Task Param Required:
false

getDocument

public org.w3c.dom.Document getDocument(org.apache.tools.ant.Task task)
                                 throws org.apache.tools.ant.BuildException
get the input as a DOM tree

Parameters:
task - enclosing task
Returns:
InputStream object for that input
Throws:
java.io.FileNotFoundException - is not supposed to happen because file existence has been tested by Input.check(Task) already
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
org.apache.tools.ant.BuildException

getFactory

protected javax.xml.parsers.DocumentBuilderFactory getFactory()
obtain a reference to the DOM factory

Returns:
DOM factory builder

setFactorySettings

protected void setFactorySettings(javax.xml.parsers.DocumentBuilderFactory factory)
set internal properties of the DOM facotry before creating a builder

Parameters:
factory -


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