org.apache.struts.tiles.xmlDefinition
Class XmlParser

java.lang.Object
  |
  +--org.apache.struts.tiles.xmlDefinition.XmlParser

public class XmlParser
extends java.lang.Object

Parse an XML definitions file.


Field Summary
protected  org.apache.commons.digester.Digester digester
          Associated digester
protected  int digesterDebugLevel
          Digester debug level.
protected  java.lang.String[] registrations
          The set of public identifiers, and corresponding resource names, for the versions of the configuration file DTDs that we know about.
protected  boolean validating
          Should we use a validating XML parser to read the configuration file.
 
Constructor Summary
XmlParser()
          Constructor.
 
Method Summary
protected  void initDigester(org.apache.commons.digester.Digester digester)
          Init digester.
private  void initDigesterForComponentsDefinitionsSyntax(org.apache.commons.digester.Digester digester)
          Init digester for components syntax.
private  void initDigesterForInstancesSyntax(org.apache.commons.digester.Digester digester)
          Init digester in order to parse instances definition file syntax.
private  void initDigesterForTilesDefinitionsSyntax(org.apache.commons.digester.Digester digester)
          Init digester for tiles syntax.
static void main(java.lang.String[] args)
          Main method to check file syntax.
 void parse(java.io.InputStream in, XmlDefinitionsSet definitions)
          Parse input reader and add encounter definitions to definitions set.
 void setDetailLevel(int detailLevel)
          Set digester detail level.
 void setValidating(boolean validating)
          Set digester validating flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

digester

protected org.apache.commons.digester.Digester digester
Associated digester


validating

protected boolean validating
Should we use a validating XML parser to read the configuration file. Default is false.


digesterDebugLevel

protected int digesterDebugLevel
Digester debug level. DEfault = 0.


registrations

protected java.lang.String[] registrations
The set of public identifiers, and corresponding resource names, for the versions of the configuration file DTDs that we know about. There MUST be an even number of Strings in this list!

Constructor Detail

XmlParser

public XmlParser()
Constructor. Create a digester parser, and initialize syntax rules.

Method Detail

setValidating

public void setValidating(boolean validating)
Set digester validating flag.


setDetailLevel

public void setDetailLevel(int detailLevel)
Set digester detail level.


initDigesterForComponentsDefinitionsSyntax

private void initDigesterForComponentsDefinitionsSyntax(org.apache.commons.digester.Digester digester)
Init digester for components syntax. This is an old set of rules, left for backward compatibilities.


initDigesterForTilesDefinitionsSyntax

private void initDigesterForTilesDefinitionsSyntax(org.apache.commons.digester.Digester digester)
Init digester for tiles syntax. Same as components, but with first element = tiles-definitions


initDigesterForInstancesSyntax

private void initDigesterForInstancesSyntax(org.apache.commons.digester.Digester digester)
Init digester in order to parse instances definition file syntax. Instances is an old name for "definition". This method is left for backward compatibility.


initDigester

protected void initDigester(org.apache.commons.digester.Digester digester)
Init digester.


parse

public void parse(java.io.InputStream in,
                  XmlDefinitionsSet definitions)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Parse input reader and add encounter definitions to definitions set.

Parameters:
in - Input stream
definitions - Xml Definitions set to which encountered definition are added.
Throws:
java.io.IOException - If an error occur during file parsing.
org.xml.sax.SAXException

main

public static void main(java.lang.String[] args)
Main method to check file syntax.



Copyright 2000-2002 - Cedric Dumoulin and Apache Software Foundation