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

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

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

Item.setPrismContext介绍

暂无

代码示例

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

/**
 * Adds an item to a property container.
 *
 * @param item item to add.
 * @throws SchemaException
 * @throws IllegalArgumentException an attempt to add value that already exists
 */
public <IV extends PrismValue,ID extends ItemDefinition> boolean add(Item<IV,ID> item, boolean checkUniqueness) throws SchemaException {
  checkMutability();
  if (item.getElementName() == null) {
    throw new IllegalArgumentException("Cannot add item without a name to value of container "+getParent());
  }
  if (checkUniqueness && findItem(item.getElementName(), Item.class) != null) {
    throw new IllegalArgumentException("Item " + item.getElementName() + " is already present in " + this.getClass().getSimpleName());
  }
  item.setParent(this);
  PrismContext prismContext = getPrismContext();
  if (prismContext != null) {
    item.setPrismContext(prismContext);
  }
  if (getComplexTypeDefinition() != null && item.getDefinition() == null) {
    item.applyDefinition((ID)determineItemDefinition(item.getElementName(), getComplexTypeDefinition()), false);
  }
  if (items == null) {
    items = new ArrayList<>();
  }
  return items.add(item);
}

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

((Item) originalValue).setPrismContext(prismContext);				// TODO - or revive? Or make sure prismContext is set here?

相关文章