Package com.evolveum.midpoint.common
Class StaticExpressionUtil
- java.lang.Object
-
- com.evolveum.midpoint.common.StaticExpressionUtil
-
public class StaticExpressionUtil extends Object
Utility class for manipulation of static values in expressions. This is not intended for a general public usage. It is used to set and get pre-computed values in expressions and mappings, e.g. when used between model and provisioning in provisioning scripts.- Author:
- Radovan Semancik
-
-
Constructor Summary
Constructors Constructor Description StaticExpressionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ItemDefinition<?>
deriveOutputDefinitionFromValueElements(QName elementName, Collection<javax.xml.bind.JAXBElement<?>> valueElements, String contextDescription, PrismContext prismContext)
static <X> PrismProperty<X>
getPropertyStatic(ExpressionType expressionType, PrismPropertyDefinition outputDefinition, String contextDescription, PrismContext prismContext)
static <X> Collection<X>
getPropertyStaticRealValues(ExpressionType expressionType, PrismPropertyDefinition outputDefinition, String contextDescription, PrismContext prismContext)
Always returns collection, even for single-valued results.static Object
getStaticOutput(ExpressionType expressionType, PrismPropertyDefinition outputDefinition, String contextDescription, ExpressionReturnMultiplicityType preferredMultiplicity, PrismContext prismContext)
Returns either Object (if result is supposed to be single-value) or Collection(if result is supposed to be multi-value) static <IV extends PrismValue,ID extends ItemDefinition<?>>
Item<IV,ID>parseValueElements(Collection<?> valueElements, ID outputDefinition, String contextDescription)
static List<Object>
parseValueElements(Collection<?> valueElements, String contextDescription)
Parses value elements without definitions into raw values - this allows further conversion.static <IV extends PrismValue,ID extends ItemDefinition<?>>
List<javax.xml.bind.JAXBElement<RawType>>serializeValueElements(Item<IV,ID> item)
-
-
-
Method Detail
-
getStaticOutput
public static Object getStaticOutput(ExpressionType expressionType, PrismPropertyDefinition outputDefinition, String contextDescription, ExpressionReturnMultiplicityType preferredMultiplicity, PrismContext prismContext) throws SchemaException
Returns either Object (if result is supposed to be single-value) or Collection(if result is supposed to be multi-value) - Throws:
SchemaException
-
getPropertyStatic
public static <X> PrismProperty<X> getPropertyStatic(ExpressionType expressionType, PrismPropertyDefinition outputDefinition, String contextDescription, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
getPropertyStaticRealValues
public static <X> Collection<X> getPropertyStaticRealValues(ExpressionType expressionType, PrismPropertyDefinition outputDefinition, String contextDescription, PrismContext prismContext) throws SchemaException
Always returns collection, even for single-valued results.- Throws:
SchemaException
-
deriveOutputDefinitionFromValueElements
public static ItemDefinition<?> deriveOutputDefinitionFromValueElements(QName elementName, Collection<javax.xml.bind.JAXBElement<?>> valueElements, String contextDescription, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
parseValueElements
public static <IV extends PrismValue,ID extends ItemDefinition<?>> Item<IV,ID> parseValueElements(Collection<?> valueElements, ID outputDefinition, String contextDescription) throws SchemaException
- Throws:
SchemaException
-
parseValueElements
public static List<Object> parseValueElements(Collection<?> valueElements, String contextDescription) throws SchemaException
Parses value elements without definitions into raw values - this allows further conversion.- Throws:
SchemaException
-
serializeValueElements
public static <IV extends PrismValue,ID extends ItemDefinition<?>> List<javax.xml.bind.JAXBElement<RawType>> serializeValueElements(Item<IV,ID> item) throws SchemaException
- Throws:
SchemaException
-
-