net.sf.ediknight.codec.xml.parser
Class XMLRecognizer
java.lang.Object
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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAGIC
private static final byte[] MAGIC
- Magic bytes we expect an XML file to start with.
parser
private XMLParser parser
XMLRecognizer
XMLRecognizer(XMLParser parser)
- Parameters:
parser - the parser
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 streamlookAhead - the number of bytes to look ahead
- Returns:
- the inspection result
- Throws:
IOException - if an I/O error occurs