crlparser
Class Parser

java.lang.Object
  extended by java.lang.Thread
      extended by crlparser.Parser
All Implemented Interfaces:
java.lang.Runnable

public abstract class Parser
extends java.lang.Thread

Author:
martin Lukac 2003 A general purpose CRL threaded XML parser It works only with files yet. The principle is the following. The parser can be started once and each object using it have to implement a parserListener. For each use the parser will synthetize the given file and the parser gives a Vector of file pointers as output encapsulated in the Parser Event to the listener. It is threaded and synchronized however an eventQueue is required for an overload in use. Without a listener the files can be retrieved by a provided public return method

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.util.Vector files
           
 java.io.PrintWriter fW
           
 ParserListener listener
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Parser()
           
 
Method Summary
 void addParserListener(ParserListener listener)
          to get the output from this parser it has to have a listener otherise the file address or stream is lost
 java.io.File[] getFiles()
           
abstract  void process(java.io.File file)
          First of two methods running this self starting threade class It parses the fille according to default of previously loaded alphabet
abstract  void process(java.lang.Object mfE)
           
 void run()
          overriden as form Thread
 void test()
           
protected  java.lang.String[] tokenize(java.lang.String input)
           
protected  java.lang.String[] tokenize(java.lang.String input, java.lang.String delim)
          Creates a parametrized tokenizer returning an array of string
static void writeCRL(org.w3c.dom.Node node, java.lang.String indent, java.io.PrintWriter fW)
          unprotected method..
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

files

protected java.util.Vector files

listener

public ParserListener listener

fW

public java.io.PrintWriter fW
Constructor Detail

Parser

public Parser()
Method Detail

addParserListener

public void addParserListener(ParserListener listener)
to get the output from this parser it has to have a listener otherise the file address or stream is lost


test

public void test()

process

public abstract void process(java.io.File file)
First of two methods running this self starting threade class It parses the fille according to default of previously loaded alphabet

Parameters:
file - - file to parse

getFiles

public java.io.File[] getFiles()
Returns:
array of files, all files for all robots or devices

process

public abstract void process(java.lang.Object mfE)

writeCRL

public static void writeCRL(org.w3c.dom.Node node,
                            java.lang.String indent,
                            java.io.PrintWriter fW)
unprotected method.. one must be sure to have the PrintWriter connected

Parameters:
node -
indent -
fW -

tokenize

protected java.lang.String[] tokenize(java.lang.String input)

tokenize

protected java.lang.String[] tokenize(java.lang.String input,
                                      java.lang.String delim)
Creates a parametrized tokenizer returning an array of string


run

public void run()
overriden as form Thread

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread