Nitido Inc.

com.nitido.nimbox.http.enhanced
Class Rule

java.lang.Object
  extended by com.nitido.nimbox.http.enhanced.Rule

public class Rule
extends java.lang.Object

The data object for rule. A rule must contain the rule type, expressions and results. A rule must contain only one control command. Currently we support two types of control command if and ifconditional. Each type of control command contains expressions that must be checked for validity and results for the case when the rule is matched. Snippet from rules XMLschema: XML schema definition for if control command XML schema definition for ifconditional control command Sample of rule from xml file: anyof User-Agent contains nokia User-Agent contains blackberry skin xhtml


Field Summary
static java.lang.String IF
          Constant for "if" type of rule.
static java.lang.String IF_ALLOF
          Constants for "if all off" type of rule
static java.lang.String IF_ANYOF
          Constants for "if any off" type of rule
 
Constructor Summary
Rule(java.lang.String type, java.util.Vector expressions, java.util.Vector results)
          Default constructor.
 
Method Summary
 java.util.Vector getExpressions()
          Get the expressions for the rule.
 java.util.Vector getResults()
          Get the results for the rule.
 java.lang.String getType()
          Get the type of the rule.
 java.lang.String toDebugString()
          This method convert the information into string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IF

public static final java.lang.String IF
Constant for "if" type of rule.

See Also:
Constant Field Values

IF_ANYOF

public static final java.lang.String IF_ANYOF
Constants for "if any off" type of rule

See Also:
Constant Field Values

IF_ALLOF

public static final java.lang.String IF_ALLOF
Constants for "if all off" type of rule

See Also:
Constant Field Values
Constructor Detail

Rule

public Rule(java.lang.String type,
            java.util.Vector expressions,
            java.util.Vector results)
Default constructor.

Parameters:
type - Indicates the type of rule.
expressions - A vector of @see Expression objects to be checked for the rule.
results - A vector of @see Result objects to be used for a matched rule.
Method Detail

getType

public java.lang.String getType()
Get the type of the rule. The type is encapsulated in following constants:
  • Rule.IF
  • Rule.IF_ANYOF
  • Rule.IF_ALLOF
  • Returns:
    The rule type.

    getExpressions

    public java.util.Vector getExpressions()
    Get the expressions for the rule.

    Returns:
    A Vector of @see Expression objects.

    getResults

    public java.util.Vector getResults()
    Get the results for the rule.

    Returns:
    A Vector of @see Result objects.

    toDebugString

    public java.lang.String toDebugString()
    This method convert the information into string. The format of the result string is "type:[expressions]:[results]".


    Nitido NiM 2.5 Java API

    These JavaDoc pages are generated for release/nim_2_5-2.5.44

    Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.