de.fuberlin.wiwiss.wiqa
Class PolicyParser

java.lang.Object
  extended byde.fuberlin.wiwiss.wiqa.PolicyParser

public class PolicyParser
extends Object

A collection of static functions for parsing WIQA policies from files and strings into Policy objects. One WIQA policy file can contain one or more policies. If it contains multiple policies, we call it a policy suite.

Version:
$Id: PolicyParser.java,v 1.3 2006/04/10 15:29:36 cyganiak Exp $
Author:
Richard Cyganiak (richard@cyganiak.de)

Method Summary
static Policy parsePolicy(Reader in)
          Parses a policy.
static Policy parsePolicy(String policyString)
          Parses a policy.
static Policy parsePolicyFromFile(String filename)
          Parses a policy.
static List parseSuite(Reader in)
          Parses a policy suite.
static List parseSuite(String suiteString)
          Parses a policy suite.
static List parseSuiteFromFile(String filename)
          Parses a policy suite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parsePolicy

public static Policy parsePolicy(String policyString)
Parses a policy. If the source contains a suite, all but the first policy will be ignored.

Parameters:
policyString - A string containing a WIQA policy
Returns:
The parsed policy

parsePolicy

public static Policy parsePolicy(Reader in)
Parses a policy. If the source contains a suite, all but the first policy will be ignored.

Parameters:
in - A reader containing a WIQA policy
Returns:
The parsed policy

parsePolicyFromFile

public static Policy parsePolicyFromFile(String filename)
                                  throws IOException
Parses a policy. If the source contains a suite, all but the first policy will be ignored.

Parameters:
filename - A file containing a WIQA policy
Returns:
The parsed policy
Throws:
IOException - On file not found and similar I/O errors

parseSuite

public static List parseSuite(String suiteString)
Parses a policy suite.

Parameters:
suiteString - A string containing a WIQA policy suite
Returns:
A list of Policy objects

parseSuite

public static List parseSuite(Reader in)
Parses a policy suite.

Parameters:
in - A reader containing a WIQA policy suite
Returns:
The parsed policies

parseSuiteFromFile

public static List parseSuiteFromFile(String filename)
                               throws IOException
Parses a policy suite.

Parameters:
filename - A file containing a WIQA policy suite
Returns:
A list of Policy objects
Throws:
IOException - On file not found and similar I/O errors