http://www.jpicedt.org

jpicedt.graphic.io.parser
Class JPICParser

java.lang.Object
  extended by jpicedt.graphic.io.parser.JPICParser
All Implemented Interfaces:
Parser

public class JPICParser
extends java.lang.Object
implements Parser

An implementation of the Parser interface dedicated to parsing JPIC-XML files.

How it works : We first try to know if we're parsing a JPIC-XML formatted file, i.e. starting with a "%%Begin JPIC-XML" marker. If this is the case :

Otherwise, go ahead using the fallback Parser, if any.

Since:
jpicedt 1.3.3
Version:
$Id: JPICParser.java,v 1.6.2.1 2007/09/02 11:56:20 reynal Exp $
Author:
Sylvain Reynal

Constructor Summary
JPICParser()
           
 
Method Summary
 Parser getFallbackParser()
          Returns the Parser that'll be called when JPIC-XML parsing fails.
static void main(java.lang.String[] args)
          for quick debugging purpose
 Drawing parse(java.io.Reader reader)
          kicks off the parsing process
 void setFallbackParser(Parser fallback)
          set the Parser that'll be called when JPIC-XML parsing fails.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPICParser

public JPICParser()
Method Detail

parse

public Drawing parse(java.io.Reader reader)
              throws ParserException
kicks off the parsing process

Specified by:
parse in interface Parser
Returns:
a new instance of a Drawing populated from the content of the given reader
Throws:
ParserException - when a parsing error was encountered, e.g. syntax error, block mismatch,...

main

public static void main(java.lang.String[] args)
for quick debugging purpose


setFallbackParser

public void setFallbackParser(Parser fallback)
set the Parser that'll be called when JPIC-XML parsing fails. This may be, e.g. a PsTricks parser, or whatsoever.


getFallbackParser

public Parser getFallbackParser()
Returns the Parser that'll be called when JPIC-XML parsing fails. This may be, e.g. a PsTricks parser, or whatsoever.


http://www.jpicedt.org

Submit a bug : syd@jpicedt.org