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 aSignatureinstance.- 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 voidaddProperty(String propName)Adds a property name to the signature.SignaturegetSignature()Gets aSignaturefor thisPathContext.Map<String,Object>getVariables()Gets a map of variables to be used.voidsetVariable(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:PathContextGets aSignaturefor thisPathContext.- Specified by:
getSignaturein interfacePathContext- Returns:
Signatureobject
-
getVariables
public Map<String,Object> getVariables()
Description copied from interface:PathContextGets a map of variables to be used.- Specified by:
getVariablesin 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.
-
-