com.ericsson.tic.vi
Class Parser

java.lang.Object
  extended by com.ericsson.tic.vi.Parser

public class Parser
extends Object

Handles all parsing and encoding.

Version:
1.0 (2008-12-04)
Author:
Sami Matilainen

Constructor Summary
Parser()
           
 
Method Summary
private static void chat(String s)
          Prints a message to all ConsolePanels.
private static void d(String s)
          Prints a message to all ConsolePanels.
private static void dbrec(String s)
          Prints a message to all ConsolePanels.
private static void def(String s)
          Prints a message to all ConsolePanels.
private static void help()
          Prints a help text message to all ConsolePanels.
static void parseMessageInput(String s)
          This method parses messages from the master system.
static void parseUserInput(String s)
          Parse user input.
static void printArr(String[] s)
          Prints an array of strings.
private static void udpsent(String s)
          Prints a message to all ConsolePanels.
private static void user(String s)
          Prints a message to all ConsolePanels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser()
Method Detail

parseMessageInput

public static void parseMessageInput(String s)
This method parses messages from the master system. It assumes that messages are structured according to one of several predefined "strategies". What strategy to use is defined in the XMLfile.

        strategy 0: (nodes)

        dataParseName           host            value
        token[0]                        token[1]        token[2]


        strategy 1: (nodes)

        dataParseName           host            category        value
        token[0]                        token[1]        token[2]        token[3]


        strategy 2: (nodes)

        dataParseName           host            category        value1          value2          ...             valueN
        token[0]                        token[1]        token[2]        token[3]        token[4]        ...             token[N+2]


        strategy 3: (relations)

        dataParseName           host_host       value
        token[0]                        token[1]        token[2]

        parsing of token[1]: (split by "_")

        host1                   host2
        token[0]                token[1]


        strategy 4: (relations)

        dataParseName           host_host       value1          value2
        token[0]                        token[1]        token[2]        token[3]

        parsing of token[1]: (split by "_")

        host1                   host2
        token[0]                token[1]
 

Parameters:
s - The server input message which needs to be parsed.

dbrec

private static void dbrec(String s)
Prints a message to all ConsolePanels.

Parameters:
s - The message

udpsent

private static void udpsent(String s)
Prints a message to all ConsolePanels.

Parameters:
s - The message

chat

private static void chat(String s)
Prints a message to all ConsolePanels.

Parameters:
s - The message

def

private static void def(String s)
Prints a message to all ConsolePanels.

Parameters:
s - The message

d

private static void d(String s)
Prints a message to all ConsolePanels.

Parameters:
s - The message

user

private static void user(String s)
Prints a message to all ConsolePanels.

Parameters:
s - The message

printArr

public static void printArr(String[] s)
Prints an array of strings.

Parameters:
s - The message

help

private static void help()
Prints a help text message to all ConsolePanels.


parseUserInput

public static void parseUserInput(String s)
Parse user input.

Parameters:
s - The message which is to be parsed.