net.sourceforge.chaperon.ant
Class ParserTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.tools.ant.taskdefs.MatchingTask
              extended bynet.sourceforge.chaperon.ant.ParserTask
All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer

public class ParserTask
extends org.apache.tools.ant.taskdefs.MatchingTask

A ant task for parsing text files

Version:
CVS $Id: ParserTask.java,v 1.6 2004/01/18 01:36:29 benedikta Exp $
Author:
Stephan Michels , Rolf Schumacher

Field Summary
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
ParserTask()
          Constructs the task
 
Method Summary
 void addConfiguredXMLCatalog(org.apache.tools.ant.types.XMLCatalog xmlCatalog)
          Add the catalog to our internal catalog
 org.apache.tools.ant.types.Mapper createMapper()
          Creates a mapper.
 void execute()
          Executes the task
 void init()
          Initialize internal instance of XMLCatalog
 void setBasedir(java.io.File dir)
          Set the base directory.
 void setCachedir(java.io.File dir)
           
 void setDestdir(java.io.File dir)
          Set the destination directory into which the result files should be copied to
 void setEncoding(java.lang.String encoding)
          Sets the encoding for the input file
 void setFlatten(boolean flatten)
          Reduces the deep of the produced hirachy by flatten nested element with same name.
 void setGrammar(java.io.File grammarFile)
          Set the grammar, which should be used.
 void setIndent(boolean indent)
          Set if the output document should be indented
 void setInputtype(java.lang.String inputtype)
          If the input document is a XML or a text document.
 void setLexicon(java.io.File lexiconFile)
          Set the lexicon, which should be used.
 void setMsglevel(java.lang.String msgLevel)
          Sets the message level.
 void setNonXmlChars(java.lang.String nonXmlChars)
          characters that should substitute non-xml characters
 void setParser(java.lang.String parserFactory)
          Name of the parser factory.
 void setSrcdir(java.io.File dir)
          Set the source directory
 void setTransformer(java.lang.String transformerFactory)
          Name of the transformer factory.
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserTask

public ParserTask()
Constructs the task

Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Executes the task

Throws:
org.apache.tools.ant.BuildException

setBasedir

public void setBasedir(java.io.File dir)
Set the base directory.

Parameters:
dir - Base directory

setSrcdir

public void setSrcdir(java.io.File dir)
Set the source directory

Parameters:
dir - Source directory

setDestdir

public void setDestdir(java.io.File dir)
Set the destination directory into which the result files should be copied to

Parameters:
dir - Destination directory

setCachedir

public void setCachedir(java.io.File dir)
Parameters:
dir - Directory for chaching objects

createMapper

public org.apache.tools.ant.types.Mapper createMapper()
                                               throws org.apache.tools.ant.BuildException
Creates a mapper.

Returns:
New mapper.
Throws:
org.apache.tools.ant.BuildException

setLexicon

public void setLexicon(java.io.File lexiconFile)
Set the lexicon, which should be used.

Parameters:
lexiconFile - Lexicon file.

setGrammar

public void setGrammar(java.io.File grammarFile)
Set the grammar, which should be used.

Parameters:
grammarFile - Grammar file.

setMsglevel

public void setMsglevel(java.lang.String msgLevel)
Sets the message level.

Parameters:
msgLevel - Message level.

setEncoding

public void setEncoding(java.lang.String encoding)
Sets the encoding for the input file

Parameters:
encoding - Encoding of the document

setIndent

public void setIndent(boolean indent)
Set if the output document should be indented

Parameters:
indent - If the output should be indented

setFlatten

public void setFlatten(boolean flatten)
Reduces the deep of the produced hirachy by flatten nested element with same name.

Parameters:
flatten - If the hirache should be reduced.

setInputtype

public void setInputtype(java.lang.String inputtype)
If the input document is a XML or a text document.

Parameters:
inputtype - Type of the input document.

setParser

public void setParser(java.lang.String parserFactory)
Name of the parser factory.

Parameters:
parserFactory - Name of the parser factory.

setTransformer

public void setTransformer(java.lang.String transformerFactory)
Name of the transformer factory.

Parameters:
transformerFactory - Name of the transformer factory.

setNonXmlChars

public void setNonXmlChars(java.lang.String nonXmlChars)
characters that should substitute non-xml characters

Parameters:
nonXmlChars - 32 charaters to replace charaters coded as U+0000 to U+0031. U+0009 (tab), U+0010 (nl/lf) and U+0013 (cr) will not be substituted cause they are valid xml characters. However the string has to be 32 characters long

addConfiguredXMLCatalog

public void addConfiguredXMLCatalog(org.apache.tools.ant.types.XMLCatalog xmlCatalog)
Add the catalog to our internal catalog

Parameters:
xmlCatalog - the XMLCatalog instance to use to look up DTDs

init

public void init()
          throws org.apache.tools.ant.BuildException
Initialize internal instance of XMLCatalog

Throws:
org.apache.tools.ant.BuildException


Copyright ? 2003 Chaperon project. All Rights Reserved.