net.sf.fikin.ant.types
Class XHTMLInput

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

public class XHTMLInput
extends XMLInput

Support input as an HTML text

Provides with ability to validate input HTML document into XHTML created on Jan 3, 2007

Since:
Version:
$Revision: 1.5 $
Author:
fiykov

Nested Class Summary
 class XHTMLInput.TmpXHTMLData
          Incorporate a temporary data in-out streams used in toXHTML conversion created on Jan 3, 2007
 
Constructor Summary
XHTMLInput()
           
 
Method Summary
 java.io.InputStream getInputStream(org.apache.tools.ant.Task task)
          get input stream either as it is or being processed by toXHTM()
protected  XHTMLInput.TmpXHTMLData newXHTMLData()
          factory method for creating tmp XHTML data object
 void setSaveXHTMLInto(java.io.File file)
          save produced by toXHTML document into a file, useful for troubleshooting purposes
 void setToXHTML(boolean toXHTML)
          perform to-XHTML transformation to the input document
protected  void toXHTMLNecko(java.io.BufferedReader in, java.io.Writer out)
          Perform html-to-xhtml conversion
protected  void writeToFile(org.apache.tools.ant.Task task, java.io.File file, java.lang.String str)
          write given string to the file
 
Methods inherited from class net.sf.fikin.ant.types.XMLInput
getDocument, getFactory, setFactorySettings, setNamespaceAware
 
Methods inherited from class net.sf.fikin.ant.types.Input
addText, check, getReader, setFile, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XHTMLInput

public XHTMLInput()
Method Detail

setToXHTML

public void setToXHTML(boolean toXHTML)
perform to-XHTML transformation to the input document

This is backed by NeckoHTML parser and does few thinks:

by default true

Parameters:
toXHTML - is true if to-XHTML transformation to the input document is to be performed
Ant Task Param Required:
false

setSaveXHTMLInto

public void setSaveXHTMLInto(java.io.File file)
save produced by toXHTML document into a file, useful for troubleshooting purposes

Parameters:
file - to store XHTML document to

Meaningful only when setToXHTML(boolean) has been set to true

Ant Task Param Required:
false

getInputStream

public java.io.InputStream getInputStream(org.apache.tools.ant.Task task)
                                   throws org.apache.tools.ant.BuildException
get input stream either as it is or being processed by toXHTM()

Overrides:
getInputStream in class Input
Parameters:
task - enclosing task
Returns:
input stream, presumably a valid XML
Throws:
java.io.FileNotFoundException - because of parent
org.apache.tools.ant.BuildException - in case some internal error occured

toXHTMLNecko

protected void toXHTMLNecko(java.io.BufferedReader in,
                            java.io.Writer out)
                     throws org.xml.sax.SAXException,
                            java.io.IOException
Perform html-to-xhtml conversion

Parameters:
in -
out -
Throws:
org.xml.sax.SAXException
java.io.IOException

writeToFile

protected void writeToFile(org.apache.tools.ant.Task task,
                           java.io.File file,
                           java.lang.String str)
                    throws java.io.IOException
write given string to the file

Parameters:
task -
file -
str -
Throws:
java.io.IOException

newXHTMLData

protected XHTMLInput.TmpXHTMLData newXHTMLData()
factory method for creating tmp XHTML data object

subject to subclassing if needed to

Returns:
TmpXHTMLData complient object


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