info.magnolia.voting.voters
Class BasePatternVoter

java.lang.Object
  extended by info.magnolia.voting.voters.BaseVoterImpl<T>
      extended by info.magnolia.voting.voters.AbstractBoolVoter<Object>
          extended by info.magnolia.voting.voters.BasePatternVoter
All Implemented Interfaces:
Voter<Object>
Direct Known Subclasses:
URIPatternVoter, URIRegexVoter, URIStartsWithVoter

public abstract class BasePatternVoter
extends AbstractBoolVoter<Object>

Voters which uses the urls to match against the pattern. The returned vote is the length of the pattern. This allows overstearing less precise votes (like allow /something/* but deny /somthing/otherthing/*). You can use the inverse property which will then return the negative value on a match. This is not the same thing as using the not property which will then vote if the pattern does not match at all. BasePatternVoter implementations are typed to because they can work with String value, but will otherwise use the ThreadLocal MgnlContext-WebContext and its AggregationState. Finally, it will use a given HttpServletRequest value.


Constructor Summary
BasePatternVoter()
           
 
Method Summary
 String getPattern()
           
 void init()
           
 boolean isInverse()
           
protected  String resolveURIFromValue(Object value)
           
 void setInverse(boolean inverse)
           
 void setPattern(String pattern)
           
 void setTrueValue(int positiveVoteValue)
           
 String toString()
           
 
Methods inherited from class info.magnolia.voting.voters.AbstractBoolVoter
boolVote, getFalseValue, getLevel, getTrueValue, isNot, setFalseValue, setLevel, setNot, vote
 
Methods inherited from class info.magnolia.voting.voters.BaseVoterImpl
getName, isEnabled, setEnabled, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasePatternVoter

public BasePatternVoter()
Method Detail

init

public void init()

setTrueValue

public void setTrueValue(int positiveVoteValue)
Overrides:
setTrueValue in class AbstractBoolVoter<Object>

getPattern

public String getPattern()

setPattern

public void setPattern(String pattern)

isInverse

public boolean isInverse()

setInverse

public void setInverse(boolean inverse)

resolveURIFromValue

protected String resolveURIFromValue(Object value)

toString

public String toString()
Overrides:
toString in class AbstractBoolVoter<Object>


Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.