com.wles.util
Class RuleParser.Constraint

java.lang.Object
  extended bycom.wles.util.RuleParser.Constraint
Enclosing class:
RuleParser

public static class RuleParser.Constraint
extends java.lang.Object

Class for representing a rule's constraint.


Field Summary
static java.lang.String IF
          String identifying the start of a constraint.
static java.lang.String TERMINATOR
          String identifying the end of a constraint.
static java.lang.String TRUE
          String identifying the contents of a default constraint.
 
Constructor Summary
RuleParser.Constraint(java.lang.String text)
          Construct a constraint based on the supplied text.
 
Method Summary
 boolean equals(java.lang.Object other)
          Tests for constraint equality.
 java.lang.String getCondition()
          Gets the condition, this is the portion between if and ;
 java.lang.String getText()
          Get the full text of the constraint this is the portion including if and ;
 int hashCode()
           
 boolean isEmpty()
          Determines if the condition is empty, or just true i.e. grant(...); or grant(...) if true;
 java.lang.String toString()
          Returns a report on the structure of the constraint.
 void validate()
          Validates that the internal string is a constraint.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IF

public static final java.lang.String IF
String identifying the start of a constraint.

See Also:
Constant Field Values

TERMINATOR

public static final java.lang.String TERMINATOR
String identifying the end of a constraint.

See Also:
Constant Field Values

TRUE

public static final java.lang.String TRUE
String identifying the contents of a default constraint.

See Also:
Constant Field Values
Constructor Detail

RuleParser.Constraint

public RuleParser.Constraint(java.lang.String text)
                      throws RuleParser.ParsingException
Construct a constraint based on the supplied text.

Method Detail

equals

public boolean equals(java.lang.Object other)
Tests for constraint equality. Requies an exact String match.


getCondition

public java.lang.String getCondition()
Gets the condition, this is the portion between if and ;


getText

public java.lang.String getText()
Get the full text of the constraint this is the portion including if and ;


hashCode

public int hashCode()

isEmpty

public boolean isEmpty()
Determines if the condition is empty, or just true i.e. grant(...); or grant(...) if true;


toString

public java.lang.String toString()
Returns a report on the structure of the constraint.


validate

public void validate()
              throws RuleParser.ParsingException
Validates that the internal string is a constraint. Only minimal syntax checking is perfomed.

Throws:
RuleParser.ParsingException


Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.