[New] Added tx.findParameterOnHierarchy() override
This commit is contained in:
parent
8a34f5330d
commit
9f47a72168
|
@ -557,6 +557,12 @@ public abstract class AbstractTransaction implements StrolchTransaction {
|
||||||
throw new StrolchModelException(MessageFormat.format(msg, locator, stateOrBagOrActivity));
|
throw new StrolchModelException(MessageFormat.format(msg, locator, stateOrBagOrActivity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <U, T extends Parameter<U>> Optional<T> findParameterOnHierarchy(StrolchRootElement element,
|
||||||
|
String parentParamKey, String paramKey) {
|
||||||
|
return findParameterOnHierarchy(element, parentParamKey, BAG_PARAMETERS, paramKey);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <U, T extends Parameter<U>> Optional<T> findParameterOnHierarchy(StrolchRootElement element,
|
public <U, T extends Parameter<U>> Optional<T> findParameterOnHierarchy(StrolchRootElement element,
|
||||||
String parentParamKey, String bagKey, String paramKey) {
|
String parentParamKey, String bagKey, String paramKey) {
|
||||||
|
|
|
@ -630,6 +630,27 @@ public interface StrolchTransaction extends AutoCloseable {
|
||||||
<T extends StrolchElement> T findElement(Locator locator, boolean allowNull)
|
<T extends StrolchElement> T findElement(Locator locator, boolean allowNull)
|
||||||
throws StrolchModelException, ClassCastException;
|
throws StrolchModelException, ClassCastException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>Finds a parameter with the {@link StrolchConstants#BAG_PARAMETERS} and @paramKey on the given @element, but if
|
||||||
|
* it does not exists
|
||||||
|
* on the element, then it retrieves the elements parent by using the bag {@link
|
||||||
|
* StrolchModelConstants#BAG_RELATIONS} and the param @parentParamKey.</p>
|
||||||
|
*
|
||||||
|
* <p>In Strolch relationships are usually defined on the parameter bag with the id {@link
|
||||||
|
* StrolchModelConstants#BAG_RELATIONS}</p>
|
||||||
|
*
|
||||||
|
* @param element
|
||||||
|
* the element on which to search for the parameter
|
||||||
|
* @param parentParamKey
|
||||||
|
* the id of the parameter with which to find the parent
|
||||||
|
* @param paramKey
|
||||||
|
* the id of the parameter to find
|
||||||
|
*
|
||||||
|
* @return the {@link Optional} with the parameter which was found, following the hierarchy up the chain
|
||||||
|
*/
|
||||||
|
<U, T extends Parameter<U>> Optional<T> findParameterOnHierarchy(StrolchRootElement element, String parentParamKey,
|
||||||
|
String paramKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Finds a parameter with the given @bagKey and @paramKey on the given @element, but if it does not exists
|
* <p>Finds a parameter with the given @bagKey and @paramKey on the given @element, but if it does not exists
|
||||||
* on the element, then it retrieves the elements parent by using the bag {@link
|
* on the element, then it retrieves the elements parent by using the bag {@link
|
||||||
|
|
Loading…
Reference in New Issue