@Override public <T extends Object> PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue) { Validate.notNull(propertyValue, "Node must not be null."); String text = getStringValue(propertyValue); if (StringUtils.isEmpty(text)) { return propertyValue; } String newValue = Normalizer.normalize(text, Form.NFD).replaceAll( "\\p{InCombiningDiacriticalMarks}+", ""); propertyValue.setValue((T) newValue); return propertyValue; } }
private <T> void normalizeValues(Collection<PrismPropertyValue<T>> values, MatchingRule<T> matchingRule) throws SchemaException { for (PrismPropertyValue<T> pval: values) { T normalizedRealValue = matchingRule.normalize(pval.getValue()); pval.setValue(normalizedRealValue); } }
@Override public <T extends Object> PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue) { Validate.notNull(propertyValue, "Node must not be null."); String value = getStringValue(propertyValue); if (StringUtils.isEmpty(value)) { return propertyValue; } Validate.notEmpty(getParameters(), "Parameters must not be null or empty."); List<Replace> replaces = getReplaces(); for (Replace replace : replaces) { Matcher matcher = replace.getPattern().matcher(value); value = matcher.replaceAll(replace.getReplacement()); } propertyValue.setValue((T) value); return propertyValue; }
Iterator<PrismPropertyValue<T>> iterator = expressionOutputValues.iterator(); PrismPropertyValue<T> firstValue = iterator.next(); configurationPropertyValue.setValue(firstValue.getValue()); while (iterator.hasNext()) { extraValues.add(iterator.next());
private <T> List<PrismPropertyValue<T>> getNormalizedValue(PrismProperty<T> attr, RefinedObjectClassDefinition rObjClassDef) throws SchemaException { RefinedAttributeDefinition<T> refinedAttributeDefinition = rObjClassDef.findAttributeDefinition(attr.getElementName()); QName matchingRuleQName = refinedAttributeDefinition.getMatchingRuleQName(); MatchingRule<T> matchingRule = matchingRuleRegistry.getMatchingRule(matchingRuleQName, refinedAttributeDefinition.getTypeName()); List<PrismPropertyValue<T>> normalized = new ArrayList<>(); for (PrismPropertyValue<T> origPValue : attr.getValues()){ T normalizedValue = matchingRule.normalize(origPValue.getValue()); PrismPropertyValue<T> normalizedPValue = origPValue.clone(); normalizedPValue.setValue(normalizedValue); normalized.add(normalizedPValue); } return normalized; }
private <T> void normalizeAttribute(ResourceAttribute<T> attribute, RefinedAttributeDefinition rAttrDef) throws SchemaException { MatchingRule<T> matchingRule = matchingRuleRegistry.getMatchingRule(rAttrDef.getMatchingRuleQName(), rAttrDef.getTypeName()); if (matchingRule != null) { for (PrismPropertyValue<T> pval: attribute.getValues()) { T normalizedRealValue = matchingRule.normalize(pval.getValue()); pval.setValue(normalizedRealValue); } } }
T normalizedRealValue = matchingRule.normalize(ppval.getValue()); PrismPropertyValue<T> newPPval = ppval.clone(); newPPval.setValue(normalizedRealValue); newValues.add(newPPval); if (normalizedRealValue != null) {
datePP.getValue().setValue(XmlTypeConverter.createXMLGregorianCalendar(yesterday)); AssertJUnit.fail("Value was changed when immutable!"); } catch (RuntimeException e) {
pval.setValue(convertedVal);
for (PrismPropertyValue pval: normalizedCurrentResourceAttrProperty.getValues()) { Object normalizedRealValue = matchingRule.normalize(pval.getValue()); pval.setValue(normalizedRealValue);