Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

cvebrowser.dictionary.data.parser
Class CSVFile  view CSVFile download CSVFile.java

java.lang.Object
  extended bycvebrowser.dictionary.data.parser.CSVFile
All Implemented Interfaces:
cvebrowser.util.parser.FileType

public final class CSVFile
extends java.lang.Object
implements cvebrowser.util.parser.FileType

Base class to manage CVE / CAN CSV files.

Version:
0.4 - 10/02/2003

Field Summary
private static java.util.ResourceBundle _bundle
           
private  java.lang.String _file
           
private  java.io.LineNumberReader _reader
          Instance to the LineNumberReader used to parse the CVS file
private static java.lang.String[] _searchPattern
           
private  java.io.InputStream _stream
           
private  int _type
           
private  java.util.HashMap _typeMap
           
private  java.lang.String _version
           
private  java.util.regex.Pattern[] _versionPattern
           
protected static int KEEP_MARK_LIMIT
          Number of chars that will be counted to keep the mark.
 
Fields inherited from interface cvebrowser.util.parser.FileType
VALID_CVE_CODE_SIZE
 
Constructor Summary
CSVFile(java.io.InputStream inputStream_)
          Parametric constructor.
CSVFile(java.lang.String file_)
          Opens a file for processing.
 
Method Summary
 java.lang.Object clone()
          Make this class uncloneable.
 void close()
          Release any opened resources.
 void finalize()
          Release any opened resources
 java.io.InputStream getInputStream()
          Return the inout stream containing the CVS file to the caller.
 java.io.LineNumberReader getLineNumberReader()
          Returns the underliying reader to the caller.
 int getType()
          Returns the type of a given file.
 java.lang.String getTypeAsString()
          Get the type as a string
 java.lang.String getVersion()
          Return the version of the given CSV (CAN or CVE) file.
protected  void init(java.io.InputStream inputStream_)
          Opens a input stream for processing.
private  void readObject(java.io.ObjectInputStream in_)
          Make this class undeserializeable.
private  void writeObject(java.io.ObjectOutputStream out_)
          Make this class unserializable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_type

private int _type

_version

private java.lang.String _version

_bundle

private static java.util.ResourceBundle _bundle

_searchPattern

private static final java.lang.String[] _searchPattern

_versionPattern

private java.util.regex.Pattern[] _versionPattern

_reader

private java.io.LineNumberReader _reader
Instance to the LineNumberReader used to parse the CVS file


_stream

private java.io.InputStream _stream

_typeMap

private java.util.HashMap _typeMap

_file

private java.lang.String _file

KEEP_MARK_LIMIT

protected static final int KEEP_MARK_LIMIT
Number of chars that will be counted to keep the mark.

See Also:
Constant Field Values
Constructor Detail

CSVFile

public CSVFile(java.lang.String file_)
        throws java.lang.IllegalArgumentException,
               cvebrowser.util.parser.ParserException,
               java.io.IOException
Opens a file for processing. The file could be uncompressed or compressed with Gzip.

Since:
0.1

CSVFile

public CSVFile(java.io.InputStream inputStream_)
        throws java.lang.IllegalArgumentException,
               cvebrowser.util.parser.ParserException,
               java.io.IOException
Parametric constructor.

Since:
0.2
Method Detail

init

protected void init(java.io.InputStream inputStream_)
             throws java.lang.IllegalArgumentException,
                    cvebrowser.util.parser.ParserException,
                    java.io.IOException
Opens a input stream for processing. The stream could be uncompressed or compressed with Gzip.

Since:
0.2

getType

public int getType()
            throws cvebrowser.util.parser.ParserException
Returns the type of a given file.

Specified by:
getType in interface cvebrowser.util.parser.FileType
Since:
0.1

getTypeAsString

public java.lang.String getTypeAsString()
                                 throws cvebrowser.util.parser.ParserException
Get the type as a string

Specified by:
getTypeAsString in interface cvebrowser.util.parser.FileType

getVersion

public java.lang.String getVersion()
                            throws cvebrowser.util.parser.ParserException
Return the version of the given CSV (CAN or CVE) file.

Since:
0.1

close

public void close()
Release any opened resources. Calling any method after this invocation will cause an error.

Since:
0.1

getLineNumberReader

public java.io.LineNumberReader getLineNumberReader()
                                             throws java.io.IOException
Returns the underliying reader to the caller.

Since:
0.1

getInputStream

public java.io.InputStream getInputStream()
Return the inout stream containing the CVS file to the caller.

Since:
0.3

finalize

public void finalize()
Release any opened resources

Since:
0.1

clone

public final java.lang.Object clone()
                             throws java.lang.CloneNotSupportedException
Make this class uncloneable. Anyone who wants to use this class must use the constructor.


writeObject

private final void writeObject(java.io.ObjectOutputStream out_)
                        throws java.io.IOException
Make this class unserializable. Any attempt to serialize will throw an exception.


readObject

private final void readObject(java.io.ObjectInputStream in_)
                       throws java.io.IOException
Make this class undeserializeable. Throw an exception if this method is ever called.