oss.net.pstream.rewrite
Class RewriteCondition

java.lang.Object
  |
  +--oss.net.pstream.rewrite.RewriteStep
        |
        +--oss.net.pstream.rewrite.RewriteCondition

public class RewriteCondition
extends RewriteStep

A rewrite condition is a rewrite step which decides if the rewrite steps which follow it should be executed.

Title:

Description:

Copyright: Copyright (c) 2002

Company:

Version:
1.0
Author:
unascribed

Field Summary
protected  boolean _case_sensitive
          Defines if this condition should be case-sensitive.
static char NC_FLAG
           
 
Fields inherited from class oss.net.pstream.rewrite.RewriteStep
REWRITE_CONDITION, REWRITE_RULE
 
Constructor Summary
RewriteCondition(java.lang.String Name, java.lang.String Flags, boolean Debug)
          The standard constructor.
 
Method Summary
 boolean getFlag(char Flag)
           
 org.apache.oro.text.regex.MatchResult getLastResult()
          Returns the result last returned by this condition.
 java.lang.String getName()
           
 int getType()
           
 RewriteVariableHandler getVariableHandler()
           
 void init(RewriteCondition PreviousCondition, RewriteRule PreviousRule, PortletStreamParameters Params)
          Initializes this condition.
 boolean isPostFetch()
          Returns true if and only if this condition contains postfetch variables.
 boolean isValid()
           
 void reset()
           
 void setFlag(char Flag)
           
 void setFlags(java.lang.String FlagTokens)
           
 void setPatternString(java.lang.String PatternString)
          Sets the regular expression pattern this condition will search with.
 void setSearchString(java.lang.String SearchString)
          Sets the value of the string this condition is to search.
 void setTarget(RewriteVariableHandler TargetHandler)
          Rewrite conditions don't actually do anything to/with the target, but rather handle their own target (which can be the rewrite target if the %{REWRITE_TARGET} variable is specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NC_FLAG

public static final char NC_FLAG
See Also:
Constant Field Values

_case_sensitive

protected boolean _case_sensitive
Defines if this condition should be case-sensitive. Defaults to TRUE.

Constructor Detail

RewriteCondition

public RewriteCondition(java.lang.String Name,
                        java.lang.String Flags,
                        boolean Debug)
                 throws RewriteException
The standard constructor.

Parameters:
Name - the Name of this step.
Flags - the flags set for this condition.
Method Detail

getLastResult

public org.apache.oro.text.regex.MatchResult getLastResult()
                                                    throws RewriteException
Returns the result last returned by this condition.

Specified by:
getLastResult in class RewriteStep
RewriteException

isPostFetch

public boolean isPostFetch()
Returns true if and only if this condition contains postfetch variables.

Specified by:
isPostFetch in class RewriteStep

setSearchString

public void setSearchString(java.lang.String SearchString)
                     throws RewriteException
Sets the value of the string this condition is to search.

Parameters:
SearchString - A string to be searched.
RewriteException

setPatternString

public void setPatternString(java.lang.String PatternString)
                      throws RewriteException
Sets the regular expression pattern this condition will search with.

Specified by:
setPatternString in class RewriteStep
RewriteException

init

public void init(RewriteCondition PreviousCondition,
                 RewriteRule PreviousRule,
                 PortletStreamParameters Params)
          throws RewriteException
Initializes this condition. This involves compiling the regular expression if and only if it has not yet been compiled and some simple validation and sanity checks. This is the init function for prefetch conditions.

Specified by:
init in class RewriteStep
Parameters:
PreviousCondition - the previous condition to this condition. Can be null.
PreviousRule - the last executed rule before this condition. Can be null.
Params - the parameters of the streamer.
RewriteException

reset

public void reset()
Specified by:
reset in class RewriteStep

isValid

public boolean isValid()
                throws RewriteException
RewriteException

getVariableHandler

public RewriteVariableHandler getVariableHandler()
Specified by:
getVariableHandler in class RewriteStep

getType

public int getType()
Specified by:
getType in class RewriteStep

getName

public java.lang.String getName()
Specified by:
getName in class RewriteStep

getFlag

public boolean getFlag(char Flag)
                throws RewriteException
RewriteException

setFlag

public void setFlag(char Flag)
             throws RewriteException
RewriteException

setTarget

public void setTarget(RewriteVariableHandler TargetHandler)
Rewrite conditions don't actually do anything to/with the target, but rather handle their own target (which can be the rewrite target if the %{REWRITE_TARGET} variable is specified.

Specified by:
setTarget in class RewriteStep

setFlags

public void setFlags(java.lang.String FlagTokens)
              throws RewriteException
RewriteException


Copyright © 2000 Dummy Corp. All Rights Reserved.