de.berlios.suzy.parser
Class RequestHandler

java.lang.Object
  extended by de.berlios.suzy.parser.RequestHandler

public class RequestHandler
extends java.lang.Object

RequestHandler is responsible for searching inside a parsed api tree. The tree is expected to be inside api.dat. If no tree is found, RequestHandler will use Parser to get a new api.dat.

Author:
honk

Method Summary
static RequestHandler getInstance()
          Get a shared ReqestHandler instance.
 java.util.List<java.lang.String> parseAll(java.lang.String pattern)
          Searches classes and methods for the pattern specified.
 java.util.List<java.lang.String> parseClasses(java.lang.String pattern)
          Searches classes for the pattern specified.
 java.util.List<java.lang.String> parseMethods(java.lang.String pattern)
          Searches methods for the pattern specified.
 void reload()
          Forces the RequestHandler to reload api.dat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RequestHandler getInstance()
Get a shared ReqestHandler instance. The API is loaded only on the first execution of this method. Subsequent calls will use the same data.

Returns:
a shared instance of RequestViewer

reload

public void reload()
Forces the RequestHandler to reload api.dat.


parseClasses

public java.util.List<java.lang.String> parseClasses(java.lang.String pattern)
Searches classes for the pattern specified. If a result is found, the matching URL will be added to a List.
The pattern will be parsed to strip all '*' from it. The rest of the pattern is matched against the class. At places where a '*' was, an arbitrary number of characters will be allowed.

Parameters:
pattern - pattern to be matched
Returns:
a List containing all matches

parseMethods

public java.util.List<java.lang.String> parseMethods(java.lang.String pattern)
Searches methods for the pattern specified. If a result is found, the matching URL will be added to a List.
The pattern will be parsed to strip all '*' from it. The rest of the pattern is matched against the method. At places where a '*' was, an arbitrary number of characters will be allowed.

Parameters:
pattern - pattern to be matched
Returns:
a List containing all matches

parseAll

public java.util.List<java.lang.String> parseAll(java.lang.String pattern)
Searches classes and methods for the pattern specified. If a result is found, the matching URL will be added to a List.
The pattern will be parsed to strip all '*' from it. The rest of the pattern is matched against the class or method. At places where a '*' was, an arbitrary number of characters will be allowed.

Parameters:
pattern - pattern to be matched
Returns:
a List containing all matches