当前位置: 首页>>代码示例>>Java>>正文


Java DOMUtil.XSD_INT属性代码示例

本文整理汇总了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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:LensUtil.java

示例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);
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:AbstractJsonLexicalProcessor.java

示例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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:16,代码来源:TestStaticValues.java

示例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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:42,代码来源:LensUtil.java


注:本文中的com.evolveum.midpoint.util.DOMUtil.XSD_INT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。