gpt4 book ai didi

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

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

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

XmlUtil.toString介绍

暂无

代码示例

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

public static String toString(final Element xml) {
  return toString(xml, false);
}

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

public static String toString(final Document document) {
  return toString(document.getDocumentElement());
}

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

public static String toString(final Document doc, final boolean addXmlDeclaration) {
  return toString(doc.getDocumentElement(), addXmlDeclaration);
}

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

public static String toString(final XmlElement xmlElement) {
  return toString(xmlElement.getDomElement(), false);
}

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

public static Document checkIsMessageOk(Document response) throws DocumentedException {
  XmlElement element = XmlElement.fromDomDocument(response);
  Preconditions.checkState(element.getName().equals(XmlMappingConstants.RPC_REPLY_KEY));
  element = element.getOnlyChildElement();
  if (element.getName().equals(XmlNetconfConstants.OK)) {
    return response;
  }
  LOG.warn("Can not load last configuration. Operation failed.");
  throw new IllegalStateException("Can not load last configuration. Operation failed: "
      + XmlUtil.toString(response));
}

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

/**
 * Search for element's attributes defining namespaces. Look for the one
 * namespace that matches prefix of element's text content. E.g.
 *
 * <pre>
 * &lt;type
 * xmlns:th-java="urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl"&gt;th-java:threadfactory-naming&lt;/type&gt;
 * </pre>
 *
 * returns {"th-java","urn:.."}. If no prefix is matched, then default
 * namespace is returned with empty string as key. If no default namespace
 * is found value will be null.
 */
public Map.Entry<String/* prefix */, String/* namespace */> findNamespaceOfTextContent() throws DocumentedException {
  Map<String, String> namespaces = extractNamespaces();
  String textContent = getTextContent();
  int indexOfColon = textContent.indexOf(':');
  String prefix;
  if (indexOfColon > -1) {
    prefix = textContent.substring(0, indexOfColon);
  } else {
    prefix = DEFAULT_NAMESPACE_PREFIX;
  }
  if (!namespaces.containsKey(prefix)) {
    throw new IllegalArgumentException("Cannot find namespace for " + XmlUtil.toString(element) + ". Prefix from content is "
        + prefix + ". Found namespaces " + namespaces);
  }
  return Maps.immutableEntry(prefix, namespaces.get(prefix));
}

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

public static void sendErrorMessage(final NetconfSession session, final DocumentedException sendErrorException,
    final NetconfMessage incommingMessage) {
  final Document errorDocument = createDocument(sendErrorException);
  if (LOG.isTraceEnabled()) {
    LOG.trace("Sending error {}", XmlUtil.toString(errorDocument));
  }
  tryToCopyAttributes(incommingMessage.getDocument(), errorDocument, sendErrorException);
  ChannelFuture f = session.sendMessage(new NetconfMessage(errorDocument));
  f.addListener(new SendErrorVerifyingListener(sendErrorException));
}

代码示例来源:origin: org.opendaylight.controller/blueprint

LOG.debug("Pushing config xml: {}", XmlUtil.toString(dataElement));

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