com.thoughtworks.xstream.io.xml.xppdom.XppDom.build()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(111)

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

XppDom.build介绍

[英]Build an XPP DOM hierarchy. The java.io.InputStream or java.io.Readerused by the parser must have already been set. The method does not close it after reading the document's end.
[中]构建一个XPP DOM层次结构。爪哇。伊奥。InputStream或java。伊奥。解析器使用的reader必须已设置。该方法在读取文档结尾后不会将其关闭。

代码示例

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

/**
   * @deprecated As of 1.4, use {@link XppDom#build(XmlPullParser)} instead
   */
  public static Xpp3Dom build(Reader reader) throws Exception {
    XmlPullParser parser = new MXParser();
    parser.setInput(reader);
    try {
      return (Xpp3Dom)XppDom.build(parser);
    } finally {
      reader.close();
    }
  }
}

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

/**
 * Build an XPP DOM hierarchy from a Reader.
 * 
 * @param r the reader
 * @throws XmlPullParserException if the default parser cannot be created or fails with invalid XML
 * @throws IOException if the data cannot be read
 * @see XppDom#build(XmlPullParser)
 * @since 1.4.1
 */
public static XppDom buildDom(Reader r) throws XmlPullParserException, IOException {
  XmlPullParser parser = createDefaultParser();
  parser.setInput(r);
  return XppDom.build(parser);
}

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

/**
   * Build an XPP DOM hierarchy from an InputStream.
   * 
   * @param in the input stream
   * @param encoding the encoding of the input stream
   * @throws XmlPullParserException if the default parser cannot be created or fails with invalid XML
   * @throws IOException if the data cannot be read
   * @see XppDom#build(XmlPullParser)
   * @since 1.4.1
   */
  public static XppDom buildDom(InputStream in, String encoding) throws XmlPullParserException, IOException {
    XmlPullParser parser = createDefaultParser();
    parser.setInput(in, encoding);
    return XppDom.build(parser);
  }
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(Reader in) {
  try {
    XmlPullParser parser = createParser();
    parser.setInput(in);
    return new XppDomReader(XppDom.build(parser), getNameCoder());
  } catch (XmlPullParserException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
   * @deprecated As of 1.4, use {@link XppDom#build(XmlPullParser)} instead
   */
  public static Xpp3Dom build(Reader reader) throws Exception {
    XmlPullParser parser = new MXParser();
    parser.setInput(reader);
    try {
      return (Xpp3Dom)XppDom.build(parser);
    } finally {
      reader.close();
    }
  }
}

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

/**
   * @deprecated As of 1.4, use {@link XppDom#build(XmlPullParser)} instead
   */
  public static Xpp3Dom build(Reader reader) throws Exception {
    XmlPullParser parser = new MXParser();
    parser.setInput(reader);
    try {
      return (Xpp3Dom)XppDom.build(parser);
    } finally {
      reader.close();
    }
  }
}

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

/**
   * @deprecated As of 1.4, use {@link XppDom#build(XmlPullParser)} instead
   */
  public static Xpp3Dom build(Reader reader) throws Exception {
    XmlPullParser parser = new MXParser();
    parser.setInput(reader);
    try {
      return (Xpp3Dom)XppDom.build(parser);
    } finally {
      reader.close();
    }
  }
}

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

/**
   * @deprecated As of 1.4, use {@link XppDom#build(XmlPullParser)} instead
   */
  public static Xpp3Dom build(Reader reader) throws Exception {
    XmlPullParser parser = new MXParser();
    parser.setInput(reader);
    try {
      return (Xpp3Dom)XppDom.build(parser);
    } finally {
      reader.close();
    }
  }
}

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

/**
   * @deprecated As of 1.4, use {@link XppDom#build(XmlPullParser)} instead
   */
  public static Xpp3Dom build(Reader reader) throws Exception {
    XmlPullParser parser = new MXParser();
    parser.setInput(reader);
    try {
      return (Xpp3Dom)XppDom.build(parser);
    } finally {
      reader.close();
    }
  }
}

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

/**
   * @deprecated As of 1.4, use {@link XppDom#build(XmlPullParser)} instead
   */
  @Deprecated
  public static Xpp3Dom build(final Reader reader) throws Exception {
    final XmlPullParser parser = new MXParser();
    parser.setInput(reader);
    try {
      return (Xpp3Dom)XppDom.build(parser);
    } finally {
      reader.close();
    }
  }
}

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

/**
 * Build an XPP DOM hierarchy from a Reader.
 * 
 * @param r the reader
 * @throws XmlPullParserException if the default parser cannot be created or fails with invalid XML
 * @throws IOException if the data cannot be read
 * @see XppDom#build(XmlPullParser)
 * @since 1.4.1
 */
public static XppDom buildDom(Reader r) throws XmlPullParserException, IOException {
  XmlPullParser parser = createDefaultParser();
  parser.setInput(r);
  return XppDom.build(parser);
}

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

/**
   * Build an XPP DOM hierarchy from an InputStream.
   * 
   * @param in the input stream
   * @param encoding the encoding of the input stream
   * @throws XmlPullParserException if the default parser cannot be created or fails with invalid XML
   * @throws IOException if the data cannot be read
   * @see XppDom#build(XmlPullParser)
   * @since 1.4.1
   */
  public static XppDom buildDom(InputStream in, String encoding) throws XmlPullParserException, IOException {
    XmlPullParser parser = createDefaultParser();
    parser.setInput(in, encoding);
    return XppDom.build(parser);
  }
}

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

/**
 * Build an XPP DOM hierarchy from a Reader.
 * 
 * @param r the reader
 * @throws XmlPullParserException if the default parser cannot be created or fails with invalid XML
 * @throws IOException if the data cannot be read
 * @see XppDom#build(XmlPullParser)
 * @since 1.4.1
 */
public static XppDom buildDom(Reader r) throws XmlPullParserException, IOException {
  XmlPullParser parser = createDefaultParser();
  parser.setInput(r);
  return XppDom.build(parser);
}

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

/**
 * Build an XPP DOM hierarchy from a Reader.
 * 
 * @param r the reader
 * @throws XmlPullParserException if the default parser cannot be created or fails with invalid XML
 * @throws IOException if the data cannot be read
 * @see XppDom#build(XmlPullParser)
 * @since 1.4.1
 */
public static XppDom buildDom(Reader r) throws XmlPullParserException, IOException {
  XmlPullParser parser = createDefaultParser();
  parser.setInput(r);
  return XppDom.build(parser);
}

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

/**
 * Build an XPP DOM hierarchy from a Reader.
 * 
 * @param r the reader
 * @throws XmlPullParserException if the default parser cannot be created or fails with invalid XML
 * @throws IOException if the data cannot be read
 * @see XppDom#build(XmlPullParser)
 * @since 1.4.1
 */
public static XppDom buildDom(Reader r) throws XmlPullParserException, IOException {
  XmlPullParser parser = createDefaultParser();
  parser.setInput(r);
  return XppDom.build(parser);
}

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

@Override
public HierarchicalStreamReader createReader(final Reader in) {
  try {
    final XmlPullParser parser = createParser();
    parser.setInput(in);
    return new XppDomReader(XppDom.build(parser), getNameCoder());
  } catch (final XmlPullParserException e) {
    throw new StreamException(e);
  } catch (final IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(Reader in) {
  try {
    XmlPullParser parser = createParser();
    parser.setInput(in);
    return new XppDomReader(XppDom.build(parser), getNameCoder());
  } catch (XmlPullParserException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(Reader in) {
  try {
    XmlPullParser parser = createParser();
    parser.setInput(in);
    return new XppDomReader(XppDom.build(parser), getNameCoder());
  } catch (XmlPullParserException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(Reader in) {
  try {
    XmlPullParser parser = createParser();
    parser.setInput(in);
    return new XppDomReader(XppDom.build(parser), getNameCoder());
  } catch (XmlPullParserException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

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

/**
 * {@inheritDoc}
 */
public HierarchicalStreamReader createReader(Reader in) {
  try {
    XmlPullParser parser = createParser();
    parser.setInput(in);
    return new XppDomReader(XppDom.build(parser), getNameCoder());
  } catch (XmlPullParserException e) {
    throw new StreamException(e);
  } catch (IOException e) {
    throw new StreamException(e);
  }
}

相关文章