Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jpicedt.graphic.io.parser
Class JPICParser

    java.lang.Object
      jpicedt.graphic.io.parser.JPICParser

All Implemented Interfaces:
  Parser

public class JPICParser
extends 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 :

- look up matching "%%End JPIC-XML" marker
- save text between both markers, and drop leading "%"
- pass corresponding text to our JPIC-XML parser (implementation based on a Java-SAX parser).
- return parsed Drawing (parsing process then stops here)

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(String[] args)` for quick debugging purpose
`Drawing` | `parse(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(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(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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug : syd@jpicedt.org