本文整理汇总了Java中com.evolveum.midpoint.util.DOMUtil.XSD_INT属性的典型用法代码示例。如果您正苦于以下问题:Java DOMUtil.XSD_INT属性的具体用法?Java DOMUtil.XSD_INT怎么用?Java DOMUtil.XSD_INT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.evolveum.midpoint.util.DOMUtil
的用法示例。
在下文中一共展示了DOMUtil.XSD_INT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIterationVariableValue
public static Object getIterationVariableValue(LensProjectionContext accCtx) {
Integer iterationOld = null;
PrismObject<ShadowType> shadowCurrent = accCtx.getObjectCurrent();
if (shadowCurrent != null) {
iterationOld = shadowCurrent.asObjectable().getIteration();
}
if (iterationOld == null) {
return accCtx.getIteration();
}
PrismPropertyDefinition<Integer> propDef = new PrismPropertyDefinitionImpl<>(ExpressionConstants.VAR_ITERATION,
DOMUtil.XSD_INT, accCtx.getPrismContext());
PrismProperty<Integer> propOld = propDef.instantiate();
propOld.setRealValue(iterationOld);
PropertyDelta<Integer> propDelta = propDef.createEmptyDelta(new ItemPath(ExpressionConstants.VAR_ITERATION));
propDelta.setValueToReplace(new PrismPropertyValue<Integer>(accCtx.getIteration()));
PrismProperty<Integer> propNew = propDef.instantiate();
propNew.setRealValue(accCtx.getIteration());
ItemDeltaItem<PrismPropertyValue<Integer>,PrismPropertyDefinition<Integer>> idi = new ItemDeltaItem<>(propOld, propDelta, propNew);
return idi;
}
示例2: determineNumberType
QName determineNumberType(JsonParser.NumberType numberType) throws SchemaException {
switch (numberType) {
case BIG_DECIMAL:
return DOMUtil.XSD_DECIMAL;
case BIG_INTEGER:
return DOMUtil.XSD_INTEGER;
case LONG:
return DOMUtil.XSD_LONG;
case INT:
return DOMUtil.XSD_INT;
case FLOAT:
return DOMUtil.XSD_FLOAT;
case DOUBLE:
return DOMUtil.XSD_DOUBLE;
default:
throw new SchemaException("Unsupported number type: " + numberType);
}
}
示例3: testValueElementsRoundtripInt
@Test
public void testValueElementsRoundtripInt() throws Exception {
final String TEST_NAME = "testValueElementsRoundtripInt";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
PrismContext prismContext = PrismTestUtil.getPrismContext();
PrismPropertyDefinitionImpl propDef = new PrismPropertyDefinitionImpl(PROP_NAME, DOMUtil.XSD_INT, prismContext);
propDef.setMaxOccurs(-1);
PrismProperty<Integer> origProperty = propDef.instantiate();
origProperty.addRealValue(42);
origProperty.addRealValue(123);
origProperty.addRealValue(321);
doRoundtrip(origProperty, propDef, prismContext);
}
示例4: formatIterationToken
public static <F extends ObjectType> String formatIterationToken(LensContext<F> context,
LensElementContext<?> accountContext, IterationSpecificationType iterationType,
int iteration, ExpressionFactory expressionFactory, ExpressionVariables variables,
Task task, OperationResult result)
throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException {
if (iterationType == null) {
return formatIterationTokenDefault(iteration);
}
ExpressionType tokenExpressionType = iterationType.getTokenExpression();
if (tokenExpressionType == null) {
return formatIterationTokenDefault(iteration);
}
PrismPropertyDefinition<String> outputDefinition = new PrismPropertyDefinitionImpl<>(ExpressionConstants.VAR_ITERATION_TOKEN,
DOMUtil.XSD_STRING, context.getPrismContext());
Expression<PrismPropertyValue<String>,PrismPropertyDefinition<String>> expression = expressionFactory.makeExpression(tokenExpressionType, outputDefinition , "iteration token expression in "+accountContext.getHumanReadableName(), task, result);
Collection<Source<?,?>> sources = new ArrayList<>();
PrismPropertyDefinitionImpl<Integer> inputDefinition = new PrismPropertyDefinitionImpl<>(ExpressionConstants.VAR_ITERATION,
DOMUtil.XSD_INT, context.getPrismContext());
inputDefinition.setMaxOccurs(1);
PrismProperty<Integer> input = inputDefinition.instantiate();
input.add(new PrismPropertyValue<Integer>(iteration));
ItemDeltaItem<PrismPropertyValue<Integer>,PrismPropertyDefinition<Integer>> idi = new ItemDeltaItem<>(input);
Source<PrismPropertyValue<Integer>,PrismPropertyDefinition<Integer>> iterationSource = new Source<>(idi, ExpressionConstants.VAR_ITERATION);
sources.add(iterationSource);
ExpressionEvaluationContext expressionContext = new ExpressionEvaluationContext(sources , variables,
"iteration token expression in "+accountContext.getHumanReadableName(), task, result);
PrismValueDeltaSetTriple<PrismPropertyValue<String>> outputTriple = ModelExpressionThreadLocalHolder.evaluateExpressionInContext(expression, expressionContext, task, result);
Collection<PrismPropertyValue<String>> outputValues = outputTriple.getNonNegativeValues();
if (outputValues.isEmpty()) {
return "";
}
if (outputValues.size() > 1) {
throw new ExpressionEvaluationException("Iteration token expression in "+accountContext.getHumanReadableName()+" returned more than one value ("+outputValues.size()+" values)");
}
String realValue = outputValues.iterator().next().getValue();
if (realValue == null) {
return "";
}
return realValue;
}