org.w3c.www.protocol.http.proxy
Class Rule
java.lang.Object
org.w3c.www.protocol.http.proxy.Rule
- All Implemented Interfaces:
- Comparable
public class Rule
- extends java.lang.Object
- implements Comparable
Field Summary |
protected static java.lang.String[] |
names
|
Constructor Summary |
Rule()
Empty constructor for dynamic instantiation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
names
protected static java.lang.String[] names
Rule
public Rule()
- Empty constructor for dynamic instantiation.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getStringValue
public java.lang.String getStringValue()
- Specified by:
getStringValue
in interface Comparable
greaterThan
public boolean greaterThan(Comparable comp)
- Specified by:
greaterThan
in interface Comparable
writeRule
public void writeRule(java.io.DataOutputStream out)
throws java.io.IOException
- Throws:
java.io.IOException
getHost
public java.lang.String getHost()
getRuleName
public java.lang.String getRuleName()
getRuleArgs
public java.lang.String getRuleArgs()
initialize
protected void initialize(java.lang.String[] tokens,
int offset,
int length)
throws RuleParserException
- Initialize the rule with given set of tokens.
- Parameters:
tokens
- The token array.offset
- Offset within above array, of tokens to initialize from.length
- Total number of tokens in above array.
- Throws:
RuleParserException
- If the rule couldn't be initialized
from given tokens.
createRule
public static Rule createRule(java.lang.String[] tokens,
int offset,
int length)
throws RuleParserException
- Create a rule, given an array of String.
- Parameters:
tokens
- Parsed tokens, as a String array.offset
- Offset of the rule tokens within above array.length
- Total number of available tokens.
- Throws:
RuleParserException
- If no rule could be created out of given
tokens.
getRulesName
public static java.lang.String[] getRulesName()
apply
public Reply apply(Request request)
- Apply given rule to the given request.
- Parameters:
request
- The request to apply the rule to.