Package org.shredzone.commons.view
Class AbstractPathContext
- java.lang.Object
-
- org.shredzone.commons.view.AbstractPathContext
-
- All Implemented Interfaces:
PathContext
@ParametersAreNonnullByDefault public abstract class AbstractPathContext extends Object implements PathContext
An abstract implementation ofPathContext
. Extending classes need to offer getters and setters for their properties. If a setter is used, the property name needs to be passed toaddProperty(String)
. In return, this class will take care for creating aSignature
instance.- Author:
- Richard "Shred" Körber
-
-
Constructor Summary
Constructors Constructor Description AbstractPathContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addProperty(String propName)
Adds a property name to the signature.Signature
getSignature()
Gets aSignature
for thisPathContext
.Map<String,Object>
getVariables()
Gets a map of variables to be used.void
setVariable(String name, Object value)
Sets a variable.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.shredzone.commons.view.PathContext
getQualifier
-
-
-
-
Constructor Detail
-
AbstractPathContext
public AbstractPathContext()
-
-
Method Detail
-
getSignature
public Signature getSignature()
Description copied from interface:PathContext
Gets aSignature
for thisPathContext
.- Specified by:
getSignature
in interfacePathContext
- Returns:
Signature
object
-
getVariables
public Map<String,Object> getVariables()
Description copied from interface:PathContext
Gets a map of variables to be used.- Specified by:
getVariables
in interfacePathContext
- Returns:
- map of variables
-
setVariable
public void setVariable(String name, Object value)
Sets a variable.- Parameters:
name
- Variable namevalue
- Variable value
-
addProperty
protected void addProperty(String propName)
Adds a property name to the signature. Subclasses must pass the property name to this method for every relevant property setter that was invoked. It is safe to call this method with the same property name multiple times.- Parameters:
propName
- name of the property that was set.
-
-