pobs
Class PContext

java.lang.Object
  extended bypobs.PContext

public class PContext
extends java.lang.Object

Immutable class containg a PDirective instance and optional a PTarget and a PErrorHandler. For threadsafe usage, a PTarget must be specified.

Author:
Martijn W. van der Lee, Franz-Josef Elmer

Constructor Summary
PContext()
          Creates an instance with a default directive, no target and no error handler.
PContext(PDirective directive)
          Creates an instance with the specified directive, no target and no error handler.
PContext(PDirective directive, PTarget target, PErrorHandler errorHandler)
          Creates an instance with the specified directive and target.
 
Method Summary
 PDirective getDirective()
          Returns parsing directive.
 PErrorHandler getErrorHandler()
          Returns error handler.
 PTarget getTarget()
          Returns action target.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PContext

public PContext()
Creates an instance with a default directive, no target and no error handler.


PContext

public PContext(PDirective directive)
Creates an instance with the specified directive, no target and no error handler.

Parameters:
directive - Parser directive. null is not allowed.
Throws:
java.lang.IllegalArgumentException - if directive == null.

PContext

public PContext(PDirective directive,
                PTarget target,
                PErrorHandler errorHandler)
Creates an instance with the specified directive and target.

Parameters:
directive - Parser directive. null is not allowed.
target - Action target. Can be null.
Throws:
java.lang.IllegalArgumentException - if directive == null.
Method Detail

getDirective

public PDirective getDirective()
Returns parsing directive.


getTarget

public PTarget getTarget()
Returns action target.

Returns:
null if undefined.

getErrorHandler

public PErrorHandler getErrorHandler()
Returns error handler.

Returns:
null if undefined.