net.sf.jmimemagic
Class MagicParser

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended bynet.sf.jmimemagic.MagicParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class MagicParser
extends org.xml.sax.helpers.DefaultHandler
implements org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler

DOCUMENT ME!

Version:
$Revision$
Author:
$Author$

Field Summary
protected static boolean DEFAULT_NAMESPACES
           
protected static java.lang.String DEFAULT_PARSER_NAME
           
protected static boolean DEFAULT_SCHEMA_FULL_CHECKING
           
protected static boolean DEFAULT_SCHEMA_VALIDATION
           
protected static boolean DEFAULT_VALIDATION
           
protected static java.lang.String NAMESPACES_FEATURE_ID
           
protected static java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
           
protected static java.lang.String SCHEMA_VALIDATION_FEATURE_ID
           
protected static java.lang.String VALIDATION_FEATURE_ID
           
 
Constructor Summary
MagicParser()
          constructor
 
Method Summary
 void characters(char[] ch, int offset, int length)
          DOCUMENT ME!
 void endDocument()
          DOCUMENT ME!
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qname)
          DOCUMENT ME!
 void error(org.xml.sax.SAXParseException ex)
          DOCUMENT ME!
 void fatalError(org.xml.sax.SAXParseException ex)
          DOCUMENT ME!
 java.util.Collection getMatchers()
          DOCUMENT ME!
 void ignorableWhitespace(char[] ch, int offset, int length)
          DOCUMENT ME!
 void initialize()
          parse the xml file and create our MagicMatcher object list
 void processingInstruction(java.lang.String target, java.lang.String data)
          DOCUMENT ME!
 void startDocument()
          DOCUMENT ME!
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qname, org.xml.sax.Attributes attributes)
          DOCUMENT ME!
 void warning(org.xml.sax.SAXParseException ex)
          DOCUMENT ME!
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
endPrefixMapping, setDocumentLocator, skippedEntity, startPrefixMapping
 

Field Detail

NAMESPACES_FEATURE_ID

protected static final java.lang.String NAMESPACES_FEATURE_ID
See Also:
Constant Field Values

VALIDATION_FEATURE_ID

protected static final java.lang.String VALIDATION_FEATURE_ID
See Also:
Constant Field Values

SCHEMA_VALIDATION_FEATURE_ID

protected static final java.lang.String SCHEMA_VALIDATION_FEATURE_ID
See Also:
Constant Field Values

SCHEMA_FULL_CHECKING_FEATURE_ID

protected static final java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
See Also:
Constant Field Values

DEFAULT_PARSER_NAME

protected static final java.lang.String DEFAULT_PARSER_NAME
See Also:
Constant Field Values

DEFAULT_NAMESPACES

protected static final boolean DEFAULT_NAMESPACES
See Also:
Constant Field Values

DEFAULT_VALIDATION

protected static final boolean DEFAULT_VALIDATION
See Also:
Constant Field Values

DEFAULT_SCHEMA_VALIDATION

protected static final boolean DEFAULT_SCHEMA_VALIDATION
See Also:
Constant Field Values

DEFAULT_SCHEMA_FULL_CHECKING

protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING
See Also:
Constant Field Values
Constructor Detail

MagicParser

public MagicParser()
constructor

Method Detail

initialize

public void initialize()
                throws MagicParseException
parse the xml file and create our MagicMatcher object list

Throws:
MagicParseException - DOCUMENT ME!

getMatchers

public java.util.Collection getMatchers()
DOCUMENT ME!

Returns:
DOCUMENT ME!

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - DOCUMENT ME!

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - DOCUMENT ME!

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Parameters:
target - DOCUMENT ME!
data - DOCUMENT ME!
Throws:
org.xml.sax.SAXException - DOCUMENT ME!

characters

public void characters(char[] ch,
                       int offset,
                       int length)
                throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
characters in interface org.xml.sax.ContentHandler
Parameters:
ch - DOCUMENT ME!
offset - DOCUMENT ME!
length - DOCUMENT ME!
Throws:
org.xml.sax.SAXException - DOCUMENT ME!

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int offset,
                                int length)
                         throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Parameters:
ch - DOCUMENT ME!
offset - DOCUMENT ME!
length - DOCUMENT ME!
Throws:
org.xml.sax.SAXException - DOCUMENT ME!

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qname,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
startElement in interface org.xml.sax.ContentHandler
Parameters:
uri - DOCUMENT ME!
localName - DOCUMENT ME!
qname - DOCUMENT ME!
attributes - DOCUMENT ME!
Throws:
org.xml.sax.SAXException - DOCUMENT ME!

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qname)
                throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
endElement in interface org.xml.sax.ContentHandler
Parameters:
uri - DOCUMENT ME!
localName - DOCUMENT ME!
qname - DOCUMENT ME!
Throws:
org.xml.sax.SAXException - DOCUMENT ME!

warning

public void warning(org.xml.sax.SAXParseException ex)
             throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
warning in interface org.xml.sax.ErrorHandler
Parameters:
ex - DOCUMENT ME!
Throws:
org.xml.sax.SAXException - DOCUMENT ME!

error

public void error(org.xml.sax.SAXParseException ex)
           throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
error in interface org.xml.sax.ErrorHandler
Parameters:
ex - DOCUMENT ME!
Throws:
org.xml.sax.SAXException - DOCUMENT ME!

fatalError

public void fatalError(org.xml.sax.SAXParseException ex)
                throws org.xml.sax.SAXException
DOCUMENT ME!

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Parameters:
ex - DOCUMENT ME!
Throws:
org.xml.sax.SAXException - DOCUMENT ME!


Copyright © 2003-2006 none. All Rights Reserved.