org.jvnet.hk2.config.Dom.setNodeElements()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(171)

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

Dom.setNodeElements介绍

[英]Updates node-element values.

Synchronized so that concurrenct modifications will work correctly.
[中]更新节点元素值。
已同步,以便并发修改能够正常工作。

代码示例

代码示例来源:origin: javaee/glassfish

public void set(Dom dom, Object arg) {
    Dom child = toDom(arg);
    if(child==null) // remove
      dom.setNodeElements(xmlName);
    else // replace
      dom.setNodeElements(xmlName,child);
  }
}

代码示例来源:origin: javaee/glassfish

public void set(Dom dom, Object _arg) {
    if(!(_arg instanceof List))
      throw new IllegalArgumentException("Expecting a list but found "+_arg);
    List arg = (List)_arg;
    Dom[] values = new Dom[arg.size()];
    int i=0;
    for (Object o : arg)
      values[i++] = toDom(o);
    dom.setNodeElements(xmlName,values);
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

public void set(Dom dom, Object arg) {
    Dom child = toDom(arg);
    if(child==null) // remove
      dom.setNodeElements(xmlName);
    else // replace
      dom.setNodeElements(xmlName,child);
  }
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

public void set(Dom dom, Object arg) {
    Dom child = toDom(arg);
    if(child==null) // remove
      dom.setNodeElements(xmlName);
    else // replace
      dom.setNodeElements(xmlName,child);
  }
}

代码示例来源:origin: org.glassfish.hk2/config

public void set(Dom dom, Object arg) {
    Dom child = toDom(arg);
    if(child==null) // remove
      dom.setNodeElements(xmlName);
    else // replace
      dom.setNodeElements(xmlName,child);
  }
}

代码示例来源:origin: com.sun.enterprise/config

public void set(Dom dom, Object arg) {
    Dom child = toDom(arg);
    if(child==null) // remove
      dom.setNodeElements(xmlName);
    else // replace
      dom.setNodeElements(xmlName,child);
  }
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

public void set(Dom dom, Object _arg) {
    if(!(_arg instanceof List))
      throw new IllegalArgumentException("Expecting a list but found "+_arg);
    List arg = (List)_arg;
    Dom[] values = new Dom[arg.size()];
    int i=0;
    for (Object o : arg)
      values[i++] = toDom(o);
    dom.setNodeElements(xmlName,values);
  }
}

代码示例来源:origin: com.sun.enterprise/config

public void set(Dom dom, Object _arg) {
    if(!(_arg instanceof List))
      throw new IllegalArgumentException("Expecting a list but found "+_arg);
    List arg = (List)_arg;
    Dom[] values = new Dom[arg.size()];
    int i=0;
    for (Object o : arg)
      values[i++] = toDom(o);
    dom.setNodeElements(xmlName,values);
  }
}

代码示例来源:origin: org.glassfish.hk2/config

public void set(Dom dom, Object _arg) {
    if(!(_arg instanceof List))
      throw new IllegalArgumentException("Expecting a list but found "+_arg);
    List arg = (List)_arg;
    Dom[] values = new Dom[arg.size()];
    int i=0;
    for (Object o : arg)
      values[i++] = toDom(o);
    dom.setNodeElements(xmlName,values);
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

public void set(Dom dom, Object _arg) {
    if(!(_arg instanceof List))
      throw new IllegalArgumentException("Expecting a list but found "+_arg);
    List arg = (List)_arg;
    Dom[] values = new Dom[arg.size()];
    int i=0;
    for (Object o : arg)
      values[i++] = toDom(o);
    dom.setNodeElements(xmlName,values);
  }
}

代码示例来源:origin: org.glassfish.admin/config-api

@Override
  public Object run(Domain writeableDomain) throws PropertyVetoException, TransactionFailure {
    ConfigBeanProxy child = writeableDomain.createChild(type);
    Dom domDomain = Dom.unwrap(writeableDomain);
    final String elementName;
    try {
      elementName = GenericCrudCommand.elementName(domDomain.document, Domain.class, type);
    } catch (ClassNotFoundException e) {
      throw new TransactionFailure(e.toString());
    }
    if (elementName==null) {
      String msg = localStrings.getLocalString(TypeResolver.class,
          "TypeResolver.no_element_of_that_type",
          "The Domain configuration does not have a sub-element of the type {0}", type.getSimpleName());
      throw new TransactionFailure(msg);
    }
    domDomain.setNodeElements(elementName, Dom.unwrap(child));
    // add to the habitat
    habitat.addIndex(new ExistingSingletonInhabitant<ConfigBeanProxy>(child), type.getName(), null);
    return child;
  }
}, domain));

代码示例来源:origin: org.glassfish.main.admin/config-api

@Override
  public Object run(Domain writeableDomain) throws PropertyVetoException, TransactionFailure {
    ConfigBeanProxy child = writeableDomain.createChild(type);
    Dom domDomain = Dom.unwrap(writeableDomain);
    final String elementName;
    try {
      elementName = GenericCrudCommand.elementName(domDomain.document, Domain.class, type);
    } catch (ClassNotFoundException e) {
      throw new TransactionFailure(e.toString());
    }
    if (elementName==null) {
      String msg = localStrings.getLocalString(TypeResolver.class,
          "TypeResolver.no_element_of_that_type",
          "The Domain configuration does not have a sub-element of the type {0}", type.getSimpleName());
      throw new TransactionFailure(msg);
    }
    domDomain.setNodeElements(elementName, Dom.unwrap(child));
    // add to the habitat
    ServiceLocatorUtilities.addOneConstant(habitat, child, null, type);
    return child;
  }
}, domain));

相关文章

微信公众号

最新文章

更多