com.sun.org.apache.xml.internal.serialize.OutputFormat.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(141)

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

OutputFormat.<init>介绍

[英]Constructs a new output format with the default values.
[中]使用默认值构造新的输出格式。

代码示例

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public XMLSerializer() {
  super( new OutputFormat( Method.XML, null, false ) );
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public HTMLSerializer( OutputFormat format )
{
  this( false, format != null ? format : new OutputFormat( Method.HTML, "ISO-8859-1", false ) );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public HTMLSerializer( OutputFormat format )
{
  this( false, format != null ? format : new OutputFormat( Method.HTML, "ISO-8859-1", false ) );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public TextSerializer()
{
  super( new OutputFormat( Method.TEXT, null, false ) );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public XHTMLSerializer( OutputFormat format )
{
  super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) );
}

代码示例来源:origin: it.tidalwave.northernwind/it-tidalwave-html-patches

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public HTMLSerializer()
{
  this( false, new OutputFormat( Method.HTML, "ISO-8859-1", false ) );
}

代码示例来源:origin: it.tidalwave.northernwind/it-tidalwave-html-patches

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public XHTMLSerializer( OutputFormat format )
{
  super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) );
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public XHTMLSerializer( OutputFormat format )
{
  super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public HTMLSerializer()
{
  this( false, new OutputFormat( Method.HTML, "ISO-8859-1", false ) );
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public TextSerializer()
{
  super( new OutputFormat( Method.TEXT, null, false ) );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public XMLSerializer() {
  super( new OutputFormat( Method.XML, null, false ) );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public XMLSerializer( OutputFormat format ) {
  super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
  _format.setMethod( Method.XML );
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * Constructs a new serializer. The serializer cannot be used without
 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
 * first.
 */
public XMLSerializer( OutputFormat format ) {
  super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
  _format.setMethod( Method.XML );
}

代码示例来源:origin: fcrepo3/fcrepo

private static OutputFormat getXmlNoSpace(String encoding) {
  OutputFormat fmt = new OutputFormat("XML", encoding, false);
  // indent == 0 means add no indenting
  fmt.setIndent(0);
  // default line width is 72, but only applies when indenting
  fmt.setLineWidth(0);
  fmt.setPreserveSpace(false);
  return fmt;
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getXmlNoSpace(String encoding) {
  OutputFormat fmt = new OutputFormat("XML", encoding, false);
  // indent == 0 means add no indenting
  fmt.setIndent(0);
  // default line width is 72, but only applies when indenting
  fmt.setLineWidth(0);
  fmt.setPreserveSpace(false);
  return fmt;
}

代码示例来源:origin: com.ibm.sbt/com.ibm.commons.xml

private XMLSerializer createXMLSerializer(Node node, Format fmt) {
  if(fmt==null) {
    fmt = Format.defaultFormat;
  }
  OutputFormat format = new OutputFormat(); //node.getOwnerDocument());
  format.setIndent(fmt.indent);
  format.setOmitXMLDeclaration(!fmt.xmlDecl);
  format.setEncoding(fmt.encoding);
  return new XMLSerializer(format);
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getPrettyPrint() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setEncoding("UTF-8");
  fmt.setIndenting(true);
  fmt.setIndent(2);
  fmt.setOmitXMLDeclaration(true);
  return fmt;
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getPrettyPrintWithDecl() {
    OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
    fmt.setEncoding("UTF-8");
    fmt.setIndenting(true);
    fmt.setIndent(2);
    fmt.setOmitXMLDeclaration(false);
    return fmt;
  }
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getConsoleWithDocType() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(80);
  fmt.setPreserveSpace(false);
  // default is false
  fmt.setOmitXMLDeclaration(false);
  // default is false
  fmt.setOmitDocumentType(false);
  return fmt;
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getMgmtWithDecl() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(120);
  fmt.setPreserveSpace(false);
  fmt.setOmitXMLDeclaration(false);
  fmt.setOmitDocumentType(true);
  return fmt;
}

相关文章