de.bsd.x2svg.parsers
Interface InputParser

All Known Implementing Classes:
BuildXmlParser, DtdParser, PropertiesParser, XsdParser

public interface InputParser

The interface, all input parsers need to implement.

Since:
1.0
Author:
hwr@pilhuhn.de

Method Summary
 java.lang.String getFileSuffix()
          Return the file suffix this parser reacts upon
 java.lang.String getMode()
          Return the mode string
 java.lang.String getSpecificHelp()
          Return a String that gives help for this specific parser.
 Container parseInput()
          Parse the input and build a tree of Containers.
 void setDebug()
          Tells the parer to set the debug mode.
 void setInputFile(java.io.File inputFile)
          Pass in the input file to parse
 void setParserOptions(java.lang.String[] options)
          Pass in options that are parser specific.
 void setWithAttributes(boolean value)
          Tells the parser that parsing attributes of elements is wanted.
 void setWithElementComments(boolean value)
          Tells the parser that parsing comments for elements (and possibly attributes) is desired.
 

Method Detail

parseInput

Container parseInput()
                     throws java.lang.Exception
Parse the input and build a tree of Containers. The method does not need to fill in the sizes (localHeight, totalHeight etc.) as those will be later filled in in a second pass

Returns:
A Container that is the root of the parsed input.
Throws:
java.lang.Exception - if anything goes wrong.
See Also:
Container

setInputFile

void setInputFile(java.io.File inputFile)
Pass in the input file to parse

Parameters:
inputFile - a File object

setParserOptions

void setParserOptions(java.lang.String[] options)
Pass in options that are parser specific. The DtdParser as an example needs a root element, while the PropertiesParser doesn't

Parameters:
options - array of individual option parts as passed on the command line.

getSpecificHelp

java.lang.String getSpecificHelp()
Return a String that gives help for this specific parser. This string should list valid command line options.

Returns:
a help string or null if no help is available.

getMode

java.lang.String getMode()
Return the mode string

Returns:
the mode string

getFileSuffix

java.lang.String getFileSuffix()
Return the file suffix this parser reacts upon

Returns:
the file suffix

setDebug

void setDebug()
Tells the parer to set the debug mode. It depends on the individual parser if it actually has a debug mode.


setWithAttributes

void setWithAttributes(boolean value)
Tells the parser that parsing attributes of elements is wanted. It depends on the individual parser if it acutally can parse them. For example the DtdParser is able to do this, while the PropertiesParser is not.

Parameters:
value - The value to set this to.

setWithElementComments

void setWithElementComments(boolean value)
Tells the parser that parsing comments for elements (and possibly attributes) is desired.
It depends on the individual parser if it actually can parse them

Parameters:
value - The value to set this to.


x2svg version 1.2.1