[New] Added IActivityElement.findRelationParam()
This commit is contained in:
parent
c4ea66ee2e
commit
8e976673f0
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package li.strolch.model.activity;
|
package li.strolch.model.activity;
|
||||||
|
|
||||||
|
import static li.strolch.model.StrolchModelConstants.BAG_RELATIONS;
|
||||||
import static li.strolch.utils.helper.StringHelper.isNotEmpty;
|
import static li.strolch.utils.helper.StringHelper.isNotEmpty;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
|
@ -345,6 +346,16 @@ public class Action extends GroupedParameterizedElement implements IActivityElem
|
||||||
return end;
|
return end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <U, T extends Parameter<U>> T findRelationParam(String paramKey) {
|
||||||
|
return findParameter(BAG_RELATIONS, paramKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <U, T extends Parameter<U>> T findRelationParam(String paramKey, boolean assertExists) {
|
||||||
|
return findParameter(BAG_RELATIONS, paramKey, assertExists);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <U, T extends Parameter<U>> T findParameter(String bagKey, String paramKey) {
|
public <U, T extends Parameter<U>> T findParameter(String bagKey, String paramKey) {
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package li.strolch.model.activity;
|
package li.strolch.model.activity;
|
||||||
|
|
||||||
|
import static li.strolch.model.StrolchModelConstants.BAG_RELATIONS;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -611,6 +613,16 @@ public class Activity extends AbstractStrolchRootElement
|
||||||
return visitor.visitActivity(this);
|
return visitor.visitActivity(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <U, T extends Parameter<U>> T findRelationParam(String paramKey) {
|
||||||
|
return findParameter(BAG_RELATIONS, paramKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <U, T extends Parameter<U>> T findRelationParam(String paramKey, boolean assertExists) {
|
||||||
|
return findParameter(BAG_RELATIONS, paramKey, assertExists);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public <U, T extends Parameter<U>> T findParameter(String bagKey, String paramKey) {
|
public <U, T extends Parameter<U>> T findParameter(String bagKey, String paramKey) {
|
||||||
|
|
|
@ -18,9 +18,7 @@ package li.strolch.model.activity;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
import li.strolch.exception.StrolchModelException;
|
import li.strolch.exception.StrolchModelException;
|
||||||
import li.strolch.model.GroupedParameterizedElement;
|
import li.strolch.model.*;
|
||||||
import li.strolch.model.State;
|
|
||||||
import li.strolch.model.StrolchElement;
|
|
||||||
import li.strolch.model.parameter.Parameter;
|
import li.strolch.model.parameter.Parameter;
|
||||||
import li.strolch.model.policy.PolicyDef;
|
import li.strolch.model.policy.PolicyDef;
|
||||||
import li.strolch.model.visitor.StrolchElementVisitor;
|
import li.strolch.model.visitor.StrolchElementVisitor;
|
||||||
|
@ -65,6 +63,34 @@ public interface IActivityElement extends StrolchElement {
|
||||||
*/
|
*/
|
||||||
void setParent(Activity activity);
|
void setParent(Activity activity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Checks if this element contains the {@link Parameter} on the {@link ParameterBag} with the id {@link
|
||||||
|
* StrolchModelConstants#BAG_RELATIONS}, or otherwise queries its parent, until the root element is reached.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* If the parameter does not exist, null is returned
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @see GroupedParameterizedElement#getRelationParam(String)
|
||||||
|
*/
|
||||||
|
<U, T extends Parameter<U>> T findRelationParam(String paramKey);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Checks if this element contains the {@link Parameter} on the {@link ParameterBag} with the id {@link
|
||||||
|
* StrolchModelConstants#BAG_RELATIONS}, or otherwise queries its parent, until the root element is reached.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* If the parameter does not exist and {@code assertExists} is true, then a {@link StrolchModelException} is thrown
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @see GroupedParameterizedElement#getRelationParam(String, boolean)
|
||||||
|
*/
|
||||||
|
<U, T extends Parameter<U>> T findRelationParam(String paramKey, boolean assertExists);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Checks if this element contains the {@link Parameter}, or otherwise queries its parent, until the root element is
|
* Checks if this element contains the {@link Parameter}, or otherwise queries its parent, until the root element is
|
||||||
|
|
Loading…
Reference in New Issue