org.kabeja.parser
Class DXFParser

java.lang.Object
  extended by org.kabeja.parser.DXFParser
All Implemented Interfaces:
DXFHandler, Handler, HandlerManager, Parser

public class DXFParser
extends java.lang.Object
implements HandlerManager, Handler, Parser, DXFHandler

Author:
Field Summary
protected  DXFSectionHandler currentHandler
           
static java.lang.String DEFAULT_ENCODING
           
protected  DXFDocument doc
           
static java.lang.String EXTENSION
           
protected  DXFHandler filter
           
protected  java.util.Hashtable handlers
           
static java.lang.String PARSER_NAME
           
protected  java.util.List streamFilters
           
 
Constructor Summary
DXFParser()
           
 
Method Summary
 void addDXFSectionHandler(DXFSectionHandler handler)
           
 void addDXFStreamFilter(DXFStreamFilter filter)
           
 void addHandler(Handler handler)
           
protected  void buildFilterChain()
           
 DXFDocument getDocument()
          Gets the parsed DXFDocument after parsing.
 java.lang.String getName()
          Gets the name of the parser.
 void parse(java.io.InputStream input, java.lang.String encoding)
          Parse the given inputstream
 void parse(java.lang.String file)
          Parse the given file.
 void parse(java.lang.String file, java.lang.String encoding)
          Parse the given file with the specific encoding.
 void parseGroup(int keyCode, DXFValue value)
           
 void releaseDXFDocument()
           
 void removeDXFStreamFilter(DXFStreamFilter filter)
           
 void setDXFDocument(DXFDocument doc)
           
 boolean supportedExtension(java.lang.String extension)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARSER_NAME

public static final java.lang.String PARSER_NAME
See Also:
Constant Field Values

EXTENSION

public static final java.lang.String EXTENSION
See Also:
Constant Field Values

DEFAULT_ENCODING

public static final java.lang.String DEFAULT_ENCODING
See Also:
Constant Field Values

doc

protected DXFDocument doc

handlers

protected java.util.Hashtable handlers

currentHandler

protected DXFSectionHandler currentHandler

streamFilters

protected java.util.List streamFilters

filter

protected DXFHandler filter
Constructor Detail

DXFParser

public DXFParser()
Method Detail

parse

public void parse(java.lang.String file)
           throws ParseException
Description copied from interface: Parser
Parse the given file.

Specified by:
parse in interface Parser
Parameters:
file - the file to parse
Throws:
ParseException

parse

public void parse(java.lang.String file,
                  java.lang.String encoding)
           throws ParseException
Description copied from interface: Parser
Parse the given file with the specific encoding.

Specified by:
parse in interface Parser
Throws:
ParseException

parse

public void parse(java.io.InputStream input,
                  java.lang.String encoding)
           throws ParseException
Description copied from interface: Parser
Parse the given inputstream

Specified by:
parse in interface Parser
Throws:
ParseException

parseGroup

public void parseGroup(int keyCode,
                       DXFValue value)
                throws ParseException
Specified by:
parseGroup in interface DXFHandler
Throws:
ParseException

getDocument

public DXFDocument getDocument()
Description copied from interface: Parser
Gets the parsed DXFDocument after parsing.

Specified by:
getDocument in interface Parser
Returns:
the parsed @see org.kabeja.dxf.DXFDocument after parsing.

addDXFSectionHandler

public void addDXFSectionHandler(DXFSectionHandler handler)

addHandler

public void addHandler(Handler handler)
Specified by:
addHandler in interface HandlerManager

releaseDXFDocument

public void releaseDXFDocument()
Specified by:
releaseDXFDocument in interface Handler

setDXFDocument

public void setDXFDocument(DXFDocument doc)
Specified by:
setDXFDocument in interface Handler

supportedExtension

public boolean supportedExtension(java.lang.String extension)
Specified by:
supportedExtension in interface Parser
Returns:

addDXFStreamFilter

public void addDXFStreamFilter(DXFStreamFilter filter)

removeDXFStreamFilter

public void removeDXFStreamFilter(DXFStreamFilter filter)

buildFilterChain

protected void buildFilterChain()

getName

public java.lang.String getName()
Description copied from interface: Parser
Gets the name of the parser.

Specified by:
getName in interface Parser
Returns: