net.sf.ediknight.codec.xml.parser
Class XMLRecognizer

Package class diagram package XMLRecognizer
java.lang.Object
  extended by net.sf.ediknight.codec.xml.parser.XMLRecognizer
All Implemented Interfaces:
net.sf.ediknight.Recognizer<XMLFormat>

final class XMLRecognizer
extends Object
implements net.sf.ediknight.Recognizer<XMLFormat>


Field Summary
private static byte[] MAGIC
          Magic bytes we expect an XML file to start with.
private  XMLParser parser
           
 
Fields inherited from interface net.sf.ediknight.Recognizer
DIRECTORY, ENCODING
 
Constructor Summary
XMLRecognizer(XMLParser parser)
           
 
Method Summary
 void addHint(String hint, Object value)
          
private  net.sf.ediknight.Inspection<XMLFormat> analyze(InputStream stream, int lookAhead)
           
 net.sf.ediknight.Inspection<XMLFormat> inspect(File file)
          
 net.sf.ediknight.Inspection<XMLFormat> inspect(InputStream stream)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAGIC

private static final byte[] MAGIC
Magic bytes we expect an XML file to start with.


parser

private XMLParser parser
Constructor Detail

XMLRecognizer

XMLRecognizer(XMLParser parser)
Parameters:
parser - the parser
Method Detail

inspect

public net.sf.ediknight.Inspection<XMLFormat> inspect(File file)

Specified by:
inspect in interface net.sf.ediknight.Recognizer<XMLFormat>
See Also:
Recognizer.inspect(java.io.File)

inspect

public net.sf.ediknight.Inspection<XMLFormat> inspect(InputStream stream)

Specified by:
inspect in interface net.sf.ediknight.Recognizer<XMLFormat>
See Also:
Recognizer.inspect(java.io.InputStream)

addHint

public void addHint(String hint,
                    Object value)

Specified by:
addHint in interface net.sf.ediknight.Recognizer<XMLFormat>
See Also:
Recognizer.addHint( java.lang.String, java.lang.Object)

analyze

private net.sf.ediknight.Inspection<XMLFormat> analyze(InputStream stream,
                                                       int lookAhead)
                                                throws IOException
Parameters:
stream - an input stream
lookAhead - the number of bytes to look ahead
Returns:
the inspection result
Throws:
IOException - if an I/O error occurs