nbi.xmlsec.xacml.util
Class SyntaxScheme

java.lang.Object
  extended bynbi.xmlsec.xacml.util.SyntaxScheme

public class SyntaxScheme
extends Object

A parser for the syntax scheme used from the RoleManager to parse conditions from the command line. The syntax scheme to define resources, actions or conditions for permissions is defined as follows: datatype-matchfunc[value]

Since:
Version:
$Revision: 1.6 $
Author:
Lutz Suhrbier

Field Summary
(package private)  List args
          The list of arguments of a function.
(package private)  String function
          The match function name.
(package private)  String functionValue
          A function, which is a value of the function.
(package private)  String value
          The value of a function.
 
Constructor Summary
SyntaxScheme(String expression)
          Creates a syntax scheme by parsing the expression argument.
 
Method Summary
 List getArgs()
          Gets the argument list of the function.
 String getFunction()
          Gets the function name.
 String getFunctionType()
          Gets the datatype of the function.
 String getFunctionValue()
          Gets the functionValue.
 String getValue()
          Gets the value of the function.
private  int indexOfClosingBracket(String expression, int iStartBracket)
          Determines the index of the next closing bracket.
private  int indexOfNextArg(String expression, int iStart)
          Determines the index of the next argument within the given expression.
private  int indexOfNextBracket(String expression, int iStartBracket)
          Determines the index of the next opening or closing bracket.
private  int indexOfOpenBracket(String expression, int iStart)
          Determines the index of the next opening bracket.
private  void parse(String expression)
          Parses the expression into the syntax scheme.
private  void parseArgs(String expression, int iStart)
          Parses the arguments of a function into the list of args.
private  int parseFunction(String expression, int startInd)
          Parses the next function name until the opening bracket is reached
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

function

String function
The match function name.


functionValue

String functionValue
A function, which is a value of the function.


value

String value
The value of a function.


args

List args
The list of arguments of a function.

Constructor Detail

SyntaxScheme

public SyntaxScheme(String expression)
Creates a syntax scheme by parsing the expression argument.

Parameters:
expression - The expression to be parsed as a syntax scheme.
Method Detail

parse

private void parse(String expression)
Parses the expression into the syntax scheme.

Parameters:
expression - The expression to be parsed as a syntax scheme.

parseFunction

private int parseFunction(String expression,
                          int startInd)
Parses the next function name until the opening bracket is reached

Parameters:
expression - The expression to be parsed.
startInd - The start index within expression.
Returns:
The index after the closing bracket of the function, or -1.

parseArgs

private void parseArgs(String expression,
                       int iStart)
Parses the arguments of a function into the list of args.

Parameters:
expression - The expression to be parsed.
iStart - The start index within expression.

indexOfNextArg

private int indexOfNextArg(String expression,
                           int iStart)
Determines the index of the next argument within the given expression.

Parameters:
expression - The expression to be parsed.
iStart - The start index within expression.
Returns:
The index after the next komma within the arguments of a function, or -1.

indexOfNextBracket

private int indexOfNextBracket(String expression,
                               int iStartBracket)
Determines the index of the next opening or closing bracket.

Parameters:
expression - The expression to be parsed.
iStartBracket - The start index within expression.
Returns:
The index of the next opening or closing bracket, or -1.

indexOfOpenBracket

private int indexOfOpenBracket(String expression,
                               int iStart)
Determines the index of the next opening bracket.

Parameters:
expression - The expression to be parsed.
iStart - The start index within expression.
Returns:
The index of the next opening bracket, or -1.

indexOfClosingBracket

private int indexOfClosingBracket(String expression,
                                  int iStartBracket)
Determines the index of the next closing bracket.

Parameters:
expression - The expression to be parsed.
iStartBracket - The start index within expression.
Returns:
The index of the next closing bracket, or -1.

getFunction

public String getFunction()
Gets the function name.

Returns:
Returns the function name.

getFunctionType

public String getFunctionType()
Gets the datatype of the function.

Returns:
Returns the datatype of the function.

getFunctionValue

public String getFunctionValue()
Gets the functionValue.

Returns:
Returns the functionValue.

getArgs

public List getArgs()
Gets the argument list of the function.

Returns:
Returns the argument list.

getValue

public String getValue()
Gets the value of the function.

Returns:
Returns the value of the function.


Copyright © 2006 Lutz Suhrbier, Freie Universitšt Berlin. All Rights Reserved.