gpt4 book ai didi

com.thoughtworks.xstream.XStreamer.toXML()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 04:45:05 27 4
gpt4 key购买 nike

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

XStreamer.toXML介绍

[英]Serialize an object including the XStream to a pretty-printed XML String.
[中]将包含XStream的对象序列化为打印精美的XML字符串。

代码示例

代码示例来源:origin: com.thoughtworks.xstream/xstream

/**
 * Serialize an object including the XStream to a pretty-printed XML String.
 * 
 * @throws ObjectStreamException if the XML contains non-serializable elements
 * @throws com.thoughtworks.xstream.XStreamException if the object cannot be serialized
 * @since 1.2
 * @see #toXML(XStream, Object, Writer)
 */
public String toXML(final XStream xstream, final Object obj) throws ObjectStreamException {
  final Writer writer = new StringWriter();
  try {
    toXML(xstream, obj, writer);
  } catch (final ObjectStreamException e) {
    throw e;
  } catch (final IOException e) {
    throw new StreamException("Unexpected IO error from a StringWriter", e);
  }
  return writer.toString();
}

代码示例来源:origin: x-stream/xstream

/**
 * Serialize an object including the XStream to a pretty-printed XML String.
 *
 * @throws ObjectStreamException if the XML contains non-serializable elements
 * @throws com.thoughtworks.xstream.XStreamException if the object cannot be serialized
 * @since 1.2
 * @see #toXML(XStream, Object, Writer)
 */
public String toXML(final XStream xstream, final Object obj) throws ObjectStreamException {
  final Writer writer = new StringWriter();
  try {
    toXML(xstream, obj, writer);
  } catch (final ObjectStreamException e) {
    throw e;
  } catch (final IOException e) {
    throw new StreamException("Unexpected IO error from a StringWriter", e);
  }
  return writer.toString();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

/**
 * Serialize an object including the XStream to a pretty-printed XML String.
 * 
 * @throws ObjectStreamException if the XML contains non-serializable elements
 * @throws com.thoughtworks.xstream.XStreamException if the object cannot be serialized
 * @since 1.2
 * @see #toXML(XStream, Object, Writer)
 */
public String toXML(final XStream xstream, final Object obj) throws ObjectStreamException {
  final Writer writer = new StringWriter();
  try {
    toXML(xstream, obj, writer);
  } catch (final ObjectStreamException e) {
    throw e;
  } catch (final IOException e) {
    throw new StreamException("Unexpected IO error from a StringWriter", e);
  }
  return writer.toString();
}

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

/**
 * Serialize an object including the XStream to a pretty-printed XML String.
 * 
 * @throws ObjectStreamException if the XML contains non-serializable elements
 * @throws com.thoughtworks.xstream.XStreamException if the object cannot be serialized
 * @since 1.2
 * @see #toXML(XStream, Object, Writer)
 */
public String toXML(XStream xstream, Object obj) throws ObjectStreamException {
  Writer writer = new StringWriter();
  try {
    toXML(xstream, obj, writer);
  } catch (ObjectStreamException e) {
    throw e;
  } catch (IOException e) {
    throw new ConversionException("Unexpeced IO error from a StringWriter", e);
  }
  return writer.toString();
}

代码示例来源:origin: org.jvnet.hudson/xstream

/**
 * Serialize an object including the XStream to a pretty-printed XML String.
 * 
 * @throws ObjectStreamException if the XML contains non-serializable elements
 * @throws com.thoughtworks.xstream.XStreamException if the object cannot be serialized
 * @since 1.2
 * @see #toXML(XStream, Object, Writer)
 */
public String toXML(XStream xstream, Object obj) throws ObjectStreamException {
  Writer writer = new StringWriter();
  try {
    toXML(xstream, obj, writer);
  } catch (ObjectStreamException e) {
    throw e;
  } catch (IOException e) {
    throw new ConversionException("Unexpeced IO error from a StringWriter", e);
  }
  return writer.toString();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

/**
 * Serialize an object including the XStream to a pretty-printed XML String.
 * 
 * @throws ObjectStreamException if the XML contains non-serializable elements
 * @throws com.thoughtworks.xstream.XStreamException if the object cannot be serialized
 * @since 1.2
 * @see #toXML(XStream, Object, Writer)
 */
public String toXML(final XStream xstream, final Object obj) throws ObjectStreamException {
  final Writer writer = new StringWriter();
  try {
    toXML(xstream, obj, writer);
  } catch (final ObjectStreamException e) {
    throw e;
  } catch (final IOException e) {
    throw new StreamException("Unexpected IO error from a StringWriter", e);
  }
  return writer.toString();
}

代码示例来源:origin: com.haulmont.thirdparty/xstream

/**
 * Serialize an object including the XStream to a pretty-printed XML String.
 * 
 * @throws ObjectStreamException if the XML contains non-serializable elements
 * @throws com.thoughtworks.xstream.XStreamException if the object cannot be serialized
 * @since 1.2
 * @see #toXML(XStream, Object, Writer)
 */
public String toXML(XStream xstream, Object obj) throws ObjectStreamException {
  Writer writer = new StringWriter();
  try {
    toXML(xstream, obj, writer);
  } catch (ObjectStreamException e) {
    throw e;
  } catch (IOException e) {
    throw new ConversionException("Unexpeced IO error from a StringWriter", e);
  }
  return writer.toString();
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

/**
 * Serialize an object including the XStream to a pretty-printed XML String.
 * 
 * @throws ObjectStreamException if the XML contains non-serializable elements
 * @throws com.thoughtworks.xstream.XStreamException if the object cannot be serialized
 * @since 1.2
 * @see #toXML(XStream, Object, Writer)
 */
public String toXML(XStream xstream, Object obj) throws ObjectStreamException {
  Writer writer = new StringWriter();
  try {
    toXML(xstream, obj, writer);
  } catch (ObjectStreamException e) {
    throw e;
  } catch (IOException e) {
    throw new ConversionException("Unexpeced IO error from a StringWriter", e);
  }
  return writer.toString();
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Serialize an object including the XStream to a pretty-printed XML String.
 * 
 * @throws ObjectStreamException if the XML contains non-serializable elements
 * @throws com.thoughtworks.xstream.XStreamException if the object cannot be serialized
 * @since 1.2
 * @see #toXML(XStream, Object, Writer)
 */
public String toXML(final XStream xstream, final Object obj) throws ObjectStreamException {
  final Writer writer = new StringWriter();
  try {
    toXML(xstream, obj, writer);
  } catch (final ObjectStreamException e) {
    throw e;
  } catch (final IOException e) {
    throw new StreamException("Unexpected IO error from a StringWriter", e);
  }
  return writer.toString();
}

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