irssibot.config
Class UserFileParser

java.lang.Object
  |
  +--irssibot.config.UserFileParser

public class UserFileParser
extends java.lang.Object

tools for parsing an user file

Author:
Matti Dahlbom

Field Summary
private  org.w3c.dom.Document document
           
private  java.lang.String userFilePath
           
private  java.util.Vector users
           
 
Constructor Summary
UserFileParser(java.lang.String userFilePath)
           
 
Method Summary
 java.util.Vector getUsers()
          get users Vector
private  void handleChannelTag(org.w3c.dom.Node node, User user)
          called from handleUserTag() to manage a -tag (represents a channel for which there are attributes defined on the user)
private  void handleUserTag(org.w3c.dom.Node node)
          handle node (represents a set of user settings) a sample tag would look like this: mask1 mask2
 boolean parse()
          invoke recursive parsing
private  boolean readUserFile()
          read XML user file from disk.
private  void recursiveParse(org.w3c.dom.Node node)
          go through the document and parse data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userFilePath

private java.lang.String userFilePath

document

private org.w3c.dom.Document document

users

private java.util.Vector users
Constructor Detail

UserFileParser

public UserFileParser(java.lang.String userFilePath)
Method Detail

parse

public boolean parse()
invoke recursive parsing


getUsers

public java.util.Vector getUsers()
get users Vector

Returns:
users

readUserFile

private boolean readUserFile()
read XML user file from disk. document will hold the parsed config data.

Returns:
true is successful

handleUserTag

private void handleUserTag(org.w3c.dom.Node node)
handle node (represents a set of user settings) a sample tag would look like this: mask1 mask2

Parameters:
node - user node

handleChannelTag

private void handleChannelTag(org.w3c.dom.Node node,
                              User user)
called from handleUserTag() to manage a -tag (represents a channel for which there are attributes defined on the user)

Parameters:
node - channel -node
user - current User instance (from handleUserTag())

recursiveParse

private void recursiveParse(org.w3c.dom.Node node)
go through the document and parse data

Parameters:
node - current node


IrssiBot (c) 2000-2002 Matti Dahlbom