com.evolveum.midpoint.prism.Item.getPath()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中com.evolveum.midpoint.prism.Item.getPath()方法的一些代码示例,展示了Item.getPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Item.getPath()方法的具体详情如下:
包路径:com.evolveum.midpoint.prism.Item
类名称:Item
方法名:getPath

Item.getPath介绍

[英]Returns the path of this item (sequence of names from the "root" container or similar object to this item). Note that if the containing object is a delta (usually a container delta), then the path
[中]返回此项的路径(从“根”容器或类似对象到此项的名称序列)。请注意,如果包含的对象是增量(通常是容器增量),则路径

代码示例

代码示例来源:origin: Evolveum/midpoint

public void removeItems(List<? extends ItemPath> itemsToRemove) {
  for (ItemPath itemToRemove : itemsToRemove) {
    Item item = findItem(itemToRemove);        // reduce to "removeItem" after fixing that method implementation
    if (item != null) {
      removeItem(item.getPath(), Item.class);
    }
  }
}

代码示例来源:origin: Evolveum/midpoint

public void keepPaths(List<? extends ItemPath> keep) {
  if (items != null) {
    for (Iterator<Item<?, ?>> iterator = items.iterator(); iterator.hasNext(); ) {
      Item<?, ?> item = iterator.next();
      ItemPath itemPath = item.getPath().removeIds();
      if (!ItemPathCollectionsUtil.containsSuperpathOrEquivalent(keep, itemPath)) {
        iterator.remove();
      } else {
        if (item instanceof PrismContainer) {
          ((PrismContainer<?>) item).getValues().forEach(v -> v.keepPaths(keep));
        } else {
          // TODO some additional checks here (e.g. when trying to keep 'name/xyz' - this is illegal)
        }
      }
    }
  }
}

代码示例来源:origin: Evolveum/midpoint

public void removePaths(List<? extends ItemPath> remove) {
  if (items != null) {
    for (Iterator<Item<?, ?>> iterator = items.iterator(); iterator.hasNext(); ) {
      Item<?, ?> item = iterator.next();
      ItemPath itemPath = item.getPath().removeIds();
      if (ItemPathCollectionsUtil.containsEquivalent(remove, itemPath)) {
        iterator.remove();
      } else if (ItemPathCollectionsUtil.containsSuperpath(remove, itemPath)) {
        if (item instanceof PrismContainer) {
          ((PrismContainer<?>) item).getValues().forEach(v -> v.removePaths(remove));
        }
      }
    }
  }
}

代码示例来源:origin: Evolveum/midpoint

public static <V extends PrismValue, D extends ItemDefinition> ItemDelta<V, D> createAddDeltaFor(Item<V, D> item) {
  ItemDelta<V, D> rv = item.createDelta(item.getPath());
  rv.addValuesToAdd(item.getClonedValues());
  return rv;
}

代码示例来源:origin: Evolveum/midpoint

@SuppressWarnings("unchecked")
public static <V extends PrismValue, D extends ItemDefinition> ItemDelta<V, D> createAddDeltaFor(Item<V, D> item,
    PrismValue value) {
  ItemDelta<V, D> rv = item.createDelta(item.getPath());
  rv.addValueToAdd((V) CloneUtil.clone(value));
  return rv;
}

代码示例来源:origin: Evolveum/midpoint

for (Item item : items) {
  if (item.getDefinition() != null) {
    boolean isHidden = NotificationFunctionsImpl.isAmongHiddenPaths(item.getPath(), hiddenPaths);
    if (!isHidden && (showOperationalAttributes || !item.getDefinition().isOperational()) && !item.isEmpty()) {
      toBeDisplayed.add(item);

代码示例来源:origin: Evolveum/midpoint

private <V extends PrismValue, D extends ItemDefinition> void msg(ValidationResult result, OperationResultStatus status, Item<V, D> item, String message) {
    ValidationItem resultItem = new ValidationItem();
    resultItem.setStatus(status);
    if (item != null) {
      resultItem.setItemPath(item.getPath());
    }
    LocalizableMessage lMessage = new SingleLocalizableMessage(null, null, message);
    resultItem.setMessage(lMessage);
    result.addItem(resultItem);
  }
}

代码示例来源:origin: Evolveum/midpoint

while (iterator.hasNext()) {
  Item<?,?> item = iterator.next();
  ItemPath itemPath = item.getPath();
  ItemDefinition<?> itemDef = item.getDefinition();
  if (itemDef != null && itemDef.isElaborate()) {

代码示例来源:origin: Evolveum/midpoint

Collection<ItemDelta<?,?>> subSubItemDeltas = new ArrayList<>();
for (ItemDelta<?,?> subItemDelta: subItemDeltas) {
  CompareResult compareComplex = subItemDelta.getPath().compareComplex(subAnyItem.getPath());
  if (compareComplex == CompareResult.EQUIVALENT || compareComplex == CompareResult.SUBPATH) {
    subSubItemDeltas.add(subItemDelta);

代码示例来源:origin: Evolveum/midpoint

ItemPath itemPath = item.getPath();
if (itemPath.isEmpty()) {
  return;

代码示例来源:origin: Evolveum/midpoint

protected void assertPrismContext(Visitable value) {
  value.accept(v -> {
    if (v instanceof Item) {
      Item item = (Item) v;
      String label = item.getPath() + ": " + v;
      assertNotNull("No prism context in " + label, item.getPrismContextLocal());
    } else if (v instanceof PrismContainerValue) {
      PrismContainerValue pcv = (PrismContainerValue) v;
      String label = pcv.getPath() + ": " + v;
      assertNotNull("No prism context in " + label, pcv.getPrismContextLocal());
    }
  });
}

代码示例来源:origin: Evolveum/midpoint

ItemPath itemPath = item.getPath();
AccessDecision itemDecision = itemDecisionFunction.decide(itemPath.namedSegmentsOnly(), removingContainer);
logSubitemDecision(itemDecision, decisionContextDesc, itemPath);

代码示例来源:origin: Evolveum/midpoint

public void applyTo(Item item, ParameterizedEquivalenceStrategy strategy) throws SchemaException {
  ItemPath itemPath = item.getPath();
  ItemPath deltaPath = getPath();
  CompareResult compareComplex = itemPath.compareComplex(deltaPath);
  if (compareComplex == CompareResult.EQUIVALENT) {
    applyToMatchingPath(item, strategy);
    cleanupAllTheWayUp(item);
  } else if (compareComplex == CompareResult.SUBPATH) {
    if (item instanceof PrismContainer<?>) {
      PrismContainer<?> container = (PrismContainer<?>)item;
      ItemPath remainderPath = deltaPath.remainder(itemPath);
      Item subItem = container.findOrCreateItem(remainderPath, getItemClass(), getDefinition());
      applyToMatchingPath(subItem, strategy);
    } else {
      throw new SchemaException("Cannot apply delta "+this+" to "+item+" as delta path is below the item path and the item is not a container");
    }
  } else if (compareComplex == CompareResult.SUPERPATH) {
    throw new SchemaException("Cannot apply delta "+this+" to "+item+" as delta path is above the item path");
  } else if (compareComplex == CompareResult.NO_RELATION) {
    throw new SchemaException("Cannot apply delta "+this+" to "+item+" as paths do not match");
  }
}

代码示例来源:origin: Evolveum/midpoint

stringValue = valuePolicyGenerator.generate(output.getPath(), valuePolicyType, DEFAULT_LENGTH, true, originResolver,
      context.getContextDescription(), context.getTask(), context.getResult());
} else {
  stringValue = valuePolicyGenerator.generate(output.getPath(), valuePolicyType, DEFAULT_LENGTH, false, originResolver,
      context.getContextDescription(), context.getTask(), context.getResult());

代码示例来源:origin: Evolveum/midpoint

protected void assertDefinitions(Visitable value) {
  value.accept(v -> {
    if (v instanceof Item) {
      Item item = (Item) v;
      String label = item.getPath() + ": " + v;
      //System.out.println("Checking " + label);
      if (item.getDefinition() == null) {
        assertTrue("No definition in " + label, isDynamic(item.getPath()));
      } else {
        assertNotNull("No prism context in definition of " + label, item.getDefinition().getPrismContext());
      }
    } else if (v instanceof PrismContainerValue) {
      PrismContainerValue pcv = (PrismContainerValue) v;
      String label = pcv.getPath() + ": " + v;
      //System.out.println("Checking " + label);
      if (pcv.getComplexTypeDefinition() == null) {
        fail("No complex type definition in " + label);
      } else {
        assertNotNull("No prism context in definition of " + label, pcv.getComplexTypeDefinition().getPrismContext());
      }
    }
  });
}

代码示例来源:origin: Evolveum/midpoint

ItemPath subPath = subItemOld.getPath().remainder(path);
PartiallyResolvedItem<IV,ID> partialValue = subItemOld.findPartial(subPath);
if (partialValue != null && partialValue.getItem() != null) {

代码示例来源:origin: Evolveum/midpoint

for (Item<?,?> item: credentialsContainer.getValue().getItems()) {
  ContainerDelta<?> cdelta = prismContext.deltaFactory().container().create
      (item.getPath(), (PrismContainerDefinition)item.getDefinition());
  cdelta.addValuesToAdd(((PrismContainer)item).getValue().clone());
  AuthorizationDecisionType cdecision = evaluateCredentialDecision(context, securityConstraints, cdelta);
  LOGGER.trace("AUTZ: credential add {} decision: {}", item.getPath(), cdecision);
  if (cdecision == AuthorizationDecisionType.ALLOW) {
    pathsToRemove.add(item.getPath());
  } else if (cdecision == AuthorizationDecisionType.DENY) {
    if (LOGGER.isTraceEnabled()) {

相关文章