|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.core.logging.activity.ResourceableTypeList
public class ResourceableTypeList
A ResourceableTypeList is a structured collection of ILoggingResourceableTypes specifying which of them are mandatory with a LoggingAction and which are optional.
The idea of ResouceableTypeList is to be able to make checks between the businessPath and all the LoggingResourceables collected during the Controller lifetime, the event handling and information passed with the log() call.
Check with the LoggingAction class to see most common use cases
of ResourceableTypeList - here's an excerpt though:
new ResourceableTypeList().
addMandatory(OlatResourceableType.wiki).
or().addMandatory(OlatResourceableType.businessGroup).addOptional(OlatResourceableType.wiki);
So the idea is to chain addMandatory and addOptional calls for as long
as types need to be added to the same list - then OR that by calling or()
and add a second/third variant which also is allowed etc etc.
As soon as one of the lists validates to true it will return true for the whole list.
Initial Date: 21.10.2009
| Constructor Summary | |
|---|---|
ResourceableTypeList()
Create an empty ResourceableTypeList. |
|
| Method Summary | |
|---|---|
ResourceableTypeList |
addMandatory(ILoggingResourceableType... resourceableTypes)
Add any number of ILoggingResourceableTypes as mandatory to this list. |
ResourceableTypeList |
addOptional(ILoggingResourceableType... resourceableTypes)
Add any number of ILoggingResourceableTypes as optional to this list. |
void |
allowAnything()
A magic-stick kind of 'allow everything' used to create a ResourceableTypeList which doesn't do any checks such as mandatory/optional/or etc at all but simply allows anything and everything. |
java.lang.String |
executeCheckAndGetErrorMessage(java.util.List<ILoggingResourceable> resourceInfos)
Executes the businessPath check on this list - this includes taking into account any or()-ed sublists. |
ResourceableTypeList |
or()
Starts a new ResourceableTypeList which is ORed with the callee list |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceableTypeList()
Call this to later add ILoggingResourceableTypes using addMandatory() and addOptional().
When a new ORed sublist needs to be created, this can be done via the convenient or() method.
| Method Detail |
|---|
public ResourceableTypeList or()
public ResourceableTypeList addMandatory(ILoggingResourceableType... resourceableTypes)
Note that addMandatory() and addOptional() methods can be chained/repeated for as often as required
resourceableTypes - the list of ILoggingResourceableTypes to be added as mandatory to this list
public ResourceableTypeList addOptional(ILoggingResourceableType... resourceableTypes)
Note that addMandatory() and addOptional() methods can be chained/repeated for as often as required
resourceableTypes - the list of ILoggingResourceableTypes to be added as optional to this list
public void allowAnything()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String executeCheckAndGetErrorMessage(java.util.List<ILoggingResourceable> resourceInfos)
resourceInfos - the list to be checked against
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||