public static <T> PrismProperty<T> createRaw(@NotNull XNode node, @NotNull QName itemName, PrismContext prismContext) throws SchemaException { Validate.isTrue(!(node instanceof RootXNode)); PrismProperty<T> property = prismContext.itemFactory().createProperty(itemName); if (node instanceof ListXNode) { for (XNode subnode : ((ListXNode) node).asList()) { property.add(createRaw(subnode, prismContext)); } } else { property.add(createRaw(node, prismContext)); } return property; }
PrismContainer<Containerable> shadow2Attrs = shadow2.findOrCreateContainer(ShadowType.F_ATTRIBUTES); PrismProperty<String> attrEntryUuid = prismContext.itemFactory().createProperty(new QName(NS_TEST_RI, "entryUuid")); PrismPropertyDefinition<String> attrEntryUuidDef = prismContext.definitionFactory().createPropertyDefinition(new QName(NS_TEST_RI, "entryUuid"), DOMUtil.XSD_STRING); attrEntryUuid.addRealValue("1234-5678-8765-4321"); PrismProperty<String> attrDn = prismContext.itemFactory().createProperty(new QName(NS_TEST_RI, "dn")); PrismPropertyDefinition<String> attrDnDef = prismContext.definitionFactory().createPropertyDefinition(new QName(NS_TEST_RI, "dn"), DOMUtil.XSD_STRING);
@SuppressWarnings({ "unused", "unchecked" }) private SceneDeltaItemImpl createSceneDeltaItem(PropertyDelta<?> delta, SceneImpl owningScene, VisualizationContext context, Task task, OperationResult result) throws SchemaException { SceneDeltaItemImpl si = createSceneDeltaItemCommon(delta, owningScene); si.setOldValues(toSceneItemValues(delta.getEstimatedOldValues())); PrismProperty property = prismContext.itemFactory().createProperty(delta.getElementName()); if (delta.getEstimatedOldValues() != null) { property.addValues(CloneUtil.cloneCollectionMembers(delta.getEstimatedOldValues())); } try { delta.applyToMatchingPath(property, ParameterizedEquivalenceStrategy.DEFAULT_FOR_DELTA_APPLICATION); } catch (SchemaException e) { throw new SystemException("Couldn't visualize property delta: " + delta + ": " + e.getMessage(), e); } computeAddedDeletedUnchanged(si, delta.getEstimatedOldValues(), property.getValues()); si.setNewValues(toSceneItemValues(property.getValues())); return si; }
PrismProperty<String> attrBazBefore = prismContext.itemFactory().createProperty(new QName(MidPointConstants.NS_RI, "baz")); MutablePrismPropertyDefinition<String> attrBazDefBefore = prismContext.definitionFactory().createPropertyDefinition(attrBazQName, DOMUtil.XSD_STRING); attrBazDefBefore.setMaxOccurs(-1);