|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faktorips.runtime.formula.FormulaEvaluatorUtil
public class FormulaEvaluatorUtil
Provides methods that can be used in formula evaluation.
Some code in formulas does not need to be generated again and again but is implemented in static methods in this class that are used by the formulas.
IFormulaEvaluator| Nested Class Summary | |
|---|---|
static class |
FormulaEvaluatorUtil.AssociationTo1Helper<S extends IModelObject,T extends IModelObject>
Helper class for navigating 1-to-1 associations from a list of source objects of type <S> to target objects of type <T>. |
static class |
FormulaEvaluatorUtil.AssociationToManyHelper<S extends IModelObject,T extends IModelObject>
Helper class for navigating 1-to-many associations from a list of source objects of type <S> to target objects of type <T>. |
static class |
FormulaEvaluatorUtil.AttributeAccessorHelper<S extends IModelObject,E>
Helper class to get the values from a list of source objects of type <S> to target
type <E>. |
static class |
FormulaEvaluatorUtil.ExistsHelper
Helper class to encapsulate a function call to verify the existence of an object that could result in an Exception (for example a NullPointerException or
IndexOutOfBoundsException when navigating over associations in model objects) which should just be treated as a false result. |
static class |
FormulaEvaluatorUtil.FunctionWithListAsArgumentHelper<E>
Base class for functions working on list arguments. |
| Method Summary | ||
|---|---|---|
static
|
getListModelObjectById(List<? extends T> modelObjects,
String id)
Returns all IConfigurableModelObject in the list that is configured by a
IProductComponent with the given ID, the list is empty if no such object is found in
the list. |
|
static
|
getModelObjectById(List<? extends T> modelObjects,
String id)
Returns the (first) IConfigurableModelObject in the list that is configured by a
IProductComponent with the given ID, null if no such object is found in the
list. |
|
static
|
getModelObjectById(T modelObject,
String id)
Returns the IModelObject if it is a IConfigurableModelObject configured by a
IProductComponent with the given ID, null otherwise. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T extends IModelObject,R extends T> R getModelObjectById(List<? extends T> modelObjects,
String id)
IConfigurableModelObject in the list that is configured by a
IProductComponent with the given ID, null if no such object is found in the
list.
T - the type of IModelObject returned by this method and expected in the listmodelObjects - a list of model objects of type id - the runtime ID this method searches
IConfigurableModelObject in the list that is configured by a
IProductComponent with the given ID, null if no such object is found
in the listgetModelObjectById(IModelObject, String)
public static <T extends IModelObject,R extends T> List<? extends R> getListModelObjectById(List<? extends T> modelObjects,
String id)
IConfigurableModelObject in the list that is configured by a
IProductComponent with the given ID, the list is empty if no such object is found in
the list.
T - the type of IModelObject returned by this method and expected in the listmodelObjects - a list of model objects of type id - the runtime ID this method searches
IConfigurableModelObject in the list that is configured by a
IProductComponent with the given ID, the list is empty if no such object is
found in the listgetModelObjectById(IModelObject, String)
public static <T extends IModelObject,R extends T> R getModelObjectById(T modelObject,
String id)
IModelObject if it is a IConfigurableModelObject configured by a
IProductComponent with the given ID, null otherwise.
T - the type of IModelObject returned and expected by this methodmodelObject - a model object of type id - the runtime ID this method searches
IModelObject if it is a IConfigurableModelObject configured by a
IProductComponent with the given ID, null otherwisegetModelObjectById(List, String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||