org.aselect.agent.authorization.parsing
Class AuthorizationRuleToken

java.lang.Object
  extended by org.aselect.agent.authorization.parsing.AuthorizationRuleToken

public class AuthorizationRuleToken
extends java.lang.Object

A token that is used when scanning, parsing and evaluating authorization rules.

Description:
This token can represent different types of tokens from an authorization rule.

Concurrency issues:
-

Author:
Alfa & Ariss

Field Summary
 int _iGroup
          The token group
 int _iKind
          The kind of token.
static int AND
          Logic and operator.
static int DATA_GROUP
          Value or key group.
static int EQUAL_TO
          Equal to operator.
static int GREATER_THEN
          Greater then operator.
static int GREATER_THEN_OR_EQUAL_TO
          Greater then or equal to operator.
static int GROUP_END
          Logic group operator end.
static int GROUP_START
          Logic group operator start.
static int IN
          "in" operator.
static int LESS_THEN
          Less then operator.
static int LESS_THEN_OR_EQUAL_TO
          less then or equal to operator.
static int LIST
          List type.
static int LOGIC_OPERATOR_GROUP
          Logic operator group.
static int MATCH_REGULAR_EXPRESSION
          Regular expression operator.
static int MATCH_WILDCARD_EXPRESSION
          Wildcar expression operator.
static int NOT
          Logic not operator.
static int NOT_EQUAL_TO
          Not equal to operator.
static int OPERATOR_GROUP
          Operator group.
static int OR
          Logic or operator.
static int QUOTED_STRING
          Quoted string type.
static int SINGLE_QUOTED_STRING
          Single quoted string type.
static int STRING
          String type.
static int UNQUOTED_STRING
          Unquoted string type.
 
Constructor Summary
AuthorizationRuleToken(int iGroup, int iKind, java.lang.Object oValue)
          Create a new AuthorizationRuleToken.
 
Method Summary
static java.lang.Object convertToKnownType(java.lang.Object oIn)
          Convert a String to known Java types.
 boolean equals(java.lang.Object o)
          Returns true if the given Object is equal to this token.
 int getGroup()
          Retrieve the token group.
 int getKind()
          retrieve the token kind.
 java.lang.Object getValue()
          Retrieve the token value.
 int hashCode()
          Returns the kind of token.
 void setValue(java.lang.Object value)
          Set a new value.
 java.lang.String toString()
          Retrieve a String representation of this token.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DATA_GROUP

public static final int DATA_GROUP
Value or key group.

See Also:
Constant Field Values

OPERATOR_GROUP

public static final int OPERATOR_GROUP
Operator group.

See Also:
Constant Field Values

LOGIC_OPERATOR_GROUP

public static final int LOGIC_OPERATOR_GROUP
Logic operator group.

See Also:
Constant Field Values

STRING

public static final int STRING
String type.

See Also:
Constant Field Values

QUOTED_STRING

public static final int QUOTED_STRING
Quoted string type.

See Also:
Constant Field Values

SINGLE_QUOTED_STRING

public static final int SINGLE_QUOTED_STRING
Single quoted string type.

See Also:
Constant Field Values

UNQUOTED_STRING

public static final int UNQUOTED_STRING
Unquoted string type.

See Also:
Constant Field Values

LIST

public static final int LIST
List type.

See Also:
Constant Field Values

GREATER_THEN

public static final int GREATER_THEN
Greater then operator.

See Also:
Constant Field Values

LESS_THEN

public static final int LESS_THEN
Less then operator.

See Also:
Constant Field Values

GREATER_THEN_OR_EQUAL_TO

public static final int GREATER_THEN_OR_EQUAL_TO
Greater then or equal to operator.

See Also:
Constant Field Values

LESS_THEN_OR_EQUAL_TO

public static final int LESS_THEN_OR_EQUAL_TO
less then or equal to operator.

See Also:
Constant Field Values

EQUAL_TO

public static final int EQUAL_TO
Equal to operator.

See Also:
Constant Field Values

NOT_EQUAL_TO

public static final int NOT_EQUAL_TO
Not equal to operator.

See Also:
Constant Field Values

IN

public static final int IN
"in" operator.

See Also:
Constant Field Values

MATCH_REGULAR_EXPRESSION

public static final int MATCH_REGULAR_EXPRESSION
Regular expression operator.

See Also:
Constant Field Values

MATCH_WILDCARD_EXPRESSION

public static final int MATCH_WILDCARD_EXPRESSION
Wildcar expression operator.

See Also:
Constant Field Values

AND

public static final int AND
Logic and operator.

See Also:
Constant Field Values

OR

public static final int OR
Logic or operator.

See Also:
Constant Field Values

NOT

public static final int NOT
Logic not operator.

See Also:
Constant Field Values

GROUP_START

public static final int GROUP_START
Logic group operator start.

See Also:
Constant Field Values

GROUP_END

public static final int GROUP_END
Logic group operator end.

See Also:
Constant Field Values

_iGroup

public int _iGroup
The token group


_iKind

public int _iKind
The kind of token.

Constructor Detail

AuthorizationRuleToken

public AuthorizationRuleToken(int iGroup,
                              int iKind,
                              java.lang.Object oValue)
Create a new AuthorizationRuleToken.

Description:
Create a new AuthorizationRuleToken with the given properties.

Concurrency issues:
-

Preconditions:
-

Postconditions:
-

Parameters:
iGroup - The token group.
iKind - The token kind.
oValue - The value of the token.
Method Detail

getGroup

public int getGroup()
Retrieve the token group.

Returns:
The token group.

getKind

public int getKind()
retrieve the token kind.

Returns:
The kind of token.

setValue

public void setValue(java.lang.Object value)
Set a new value.

Parameters:
value - The value to be set.

getValue

public java.lang.Object getValue()
Retrieve the token value.

Returns:
The value of the token.

hashCode

public int hashCode()
Returns the kind of token.

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object o)
Returns true if the given Object is equal to this token.

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Retrieve a String representation of this token.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

convertToKnownType

public static java.lang.Object convertToKnownType(java.lang.Object oIn)
Convert a String to known Java types.
Tries to create the following objects if oIn is a String: If no other object can be created oIn is returned.
Preconditions:
oIn != null
Postconditions:
-

Parameters:
oIn - the Object to be converted.
Returns:
The converted object.


Copyright © 2008 SURFnet BV. All Rights Reserved.