gpt4 book ai didi

org.opendaylight.controller.config.util.xml.XmlUtil.createTextElement()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 01:27:05 28 4
gpt4 key购买 nike

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

XmlUtil.createTextElement介绍

暂无

代码示例

代码示例来源:origin: org.opendaylight.controller/config-util

public static Element createTextElementWithNamespacedContent(final Document document, final String qName, final String prefix,
                               final String namespace, final String contentWithoutPrefix, final Optional<String> namespaceURI) {
  String content = createPrefixedValue(XmlMappingConstants.PREFIX, contentWithoutPrefix);
  Element element = createTextElement(document, qName, content, namespaceURI);
  String prefixedNamespaceAttr = createPrefixedValue(XMLNS_ATTRIBUTE_KEY, prefix);
  element.setAttributeNS(XMLNS_URI, prefixedNamespaceAttr, namespace);
  return element;
}

代码示例来源:origin: org.opendaylight.netconf/netconf-monitoring

@Override
protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement xml) throws DocumentedException {
  final GetSchemaEntry entry;
  entry = new GetSchemaEntry(xml);
  final String schema;
  try {
    schema = cap.getSchemaForCapability(entry.identifier, entry.version);
  } catch (final IllegalStateException e) {
    final Map<String, String> errorInfo = Maps.newHashMap();
    errorInfo.put(entry.identifier, e.getMessage());
    LOG.warn("Rpc error: {}", DocumentedException.ErrorTag.operation_failed, e);
    throw new DocumentedException(e.getMessage(), DocumentedException.ErrorType.application,
        DocumentedException.ErrorTag.operation_failed,
        DocumentedException.ErrorSeverity.error, errorInfo);
  }
  final Element getSchemaResult;
  getSchemaResult = XmlUtil.createTextElement(document, XmlNetconfConstants.DATA_KEY, schema,
      Optional.of(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_YANG_IETF_NETCONF_MONITORING));
  LOG.trace("{} operation successful", GET_SCHEMA);
  return getSchemaResult;
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com