public abstract class XParser
extends java.lang.Object
| Constructor and Description |
|---|
XParser() |
| Modifier and Type | Method and Description |
|---|---|
abstract java.lang.String |
author()
Returns the name of the author of this parser.
|
abstract boolean |
canParse(java.io.File file)
Checks whether this parser can handle the given file.
|
abstract java.lang.String |
description()
Returns a brief description of this parser.
|
protected boolean |
endsWithIgnoreCase(java.lang.String name,
java.lang.String suffix)
Returns whether the given file name ends (ignoring the case) with the given suffix.
|
abstract java.lang.String |
name()
Returns the name of this parser or, more specifically,
the name of the format it can process.
|
java.util.List<XOCLog> |
parse(java.io.File file)
Parses the given file, and returns the XLog instances
extracted.
|
abstract java.util.List<XOCLog> |
parse(java.io.InputStream is)
Parses the given input stream, and returns the
XLog instances extracted.
|
java.lang.String |
toString()
toString() defaults to name().
|
public abstract java.lang.String name()
public abstract java.lang.String description()
public abstract java.lang.String author()
public abstract boolean canParse(java.io.File file)
file - File to check against parser.public abstract java.util.List<XOCLog> parse(java.io.InputStream is) throws java.lang.Exception
is - Stream to read XLog instances from.java.lang.Exceptionpublic java.util.List<XOCLog> parse(java.io.File file) throws java.lang.Exception
IOException.file - The file to be parsed.java.lang.Exception - Raised in case the parser fails, or the
given file cannot be processed.public java.lang.String toString()
toString in class java.lang.Objectprotected boolean endsWithIgnoreCase(java.lang.String name,
java.lang.String suffix)
name - The given file name.suffix - The given suffix.