com.helger.xml.serialize.write.XMLWriterSettings.<init>()方法的使用及代码示例

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

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

XMLWriterSettings.<init>介绍

[英]Creates a default settings object with the following settings:

  • XML version 1.0
  • with XML declaration
  • with document type
  • with comments
  • Indented and aligned
  • Writing invalid characters to the file as is - may result in invalid XML files
  • Default character set UTF-8
  • No namespace context
    [中]使用以下设置创建默认设置对象:
    *XML 1.0版
    *使用XML声明
    *使用文档类型
    *带着评论
    *缩进和对齐
    *按原样将无效字符写入文件-可能会导致XML文件无效
    *默认字符集UTF-8
    *没有命名空间上下文

代码示例

代码示例来源:origin: com.helger/ph-xml

@Nonnull
public XMLWriterSettings getClone ()
{
 return new XMLWriterSettings (this);
}

代码示例来源:origin: com.helger/ph-xml

/**
 * Constructor for W3C nodes.
 *
 * @param aNode
 *        The node to be streamed. May not be <code>null</code>.
 * @param aCharset
 *        The charset to use. May not be <code>null</code>.
 */
public DOMInputStreamProvider (@Nonnull final Node aNode, @Nonnull final Charset aCharset)
{
 this (aNode, new XMLWriterSettings ().setCharset (aCharset));
}

代码示例来源:origin: com.helger/ph-schematron

@Nonnull
public IPSWriterSettings setXMLWriterSettings (@Nonnull final IXMLWriterSettings aXMLWriterSettings)
{
 ValueEnforcer.notNull (aXMLWriterSettings, "XMLWriterSettings");
 m_aXMLWriterSettings = new XMLWriterSettings (aXMLWriterSettings);
 return this;
}

代码示例来源:origin: com.helger/ph-schematron

@Nonnull
@ReturnsMutableCopy
public XMLWriterSettings getXMLWriterSettings ()
{
 return new XMLWriterSettings (m_aXMLWriterSettings);
}

代码示例来源:origin: com.helger/ph-xml

/**
 * Constructor for MicroNodes.
 *
 * @param aNode
 *        The node to be streamed. May not be <code>null</code>.
 * @param aCharset
 *        The charset to use. May not be <code>null</code>.
 */
public MicroDOMInputStreamProvider (@Nonnull final IMicroNode aNode, @Nonnull final Charset aCharset)
{
 this (aNode, new XMLWriterSettings ().setCharset (aCharset));
}

代码示例来源:origin: phax/ph-schematron

@Nonnull
@ReturnsMutableCopy
public XMLWriterSettings getXMLWriterSettings ()
{
 return new XMLWriterSettings (m_aXMLWriterSettings);
}

代码示例来源:origin: phax/ph-schematron

@Nonnull
public IPSWriterSettings setXMLWriterSettings (@Nonnull final IXMLWriterSettings aXMLWriterSettings)
{
 ValueEnforcer.notNull (aXMLWriterSettings, "XMLWriterSettings");
 m_aXMLWriterSettings = new XMLWriterSettings (aXMLWriterSettings);
 return this;
}

代码示例来源:origin: com.helger/ph-html

/**
 * Set the XML writer settings to be used. By default values equivalent to
 * {@link XMLWriterSettings#DEFAULT_XML_SETTINGS} are used.
 *
 * @param aXMLWriterSettings
 *        The XML writer settings to be used. May not be <code>null</code>.
 * @return this
 */
@Nonnull
public HCConversionSettings setXMLWriterSettings (@Nonnull final IXMLWriterSettings aXMLWriterSettings)
{
 ValueEnforcer.notNull (aXMLWriterSettings, "XMLWriterSettings");
 // The objects are cached with indent and no-indent for performance reasons
 m_aXMLWriterSettings = new XMLWriterSettings (aXMLWriterSettings);
 return this;
}

代码示例来源:origin: com.helger/ph-xml

@Nonnull
@ReturnsMutableCopy
public static XMLWriterSettings createForHTML4 ()
{
 return new XMLWriterSettings ().setSerializeVersion (EXMLSerializeVersion.HTML)
                 .setSerializeXMLDeclaration (EXMLSerializeXMLDeclaration.IGNORE)
                 .setIndentDeterminator (new XMLIndentDeterminatorHTML ())
                 .setBracketModeDeterminator (new XMLBracketModeDeterminatorHTML4 ())
                 .setSpaceOnSelfClosedElement (true)
                 .setPutNamespaceContextPrefixesInRoot (true);
}

代码示例来源:origin: com.helger/ph-xml

@Nonnull
@ReturnsMutableCopy
public static XMLWriterSettings createForXHTML ()
{
 return new XMLWriterSettings ().setSerializeVersion (EXMLSerializeVersion.HTML)
                 .setSerializeXMLDeclaration (EXMLSerializeXMLDeclaration.IGNORE)
                 .setIndentDeterminator (new XMLIndentDeterminatorHTML ())
                 .setBracketModeDeterminator (new XMLBracketModeDeterminatorXML ())
                 .setSpaceOnSelfClosedElement (true)
                 .setPutNamespaceContextPrefixesInRoot (true);
}

代码示例来源:origin: com.helger/ph-xml

@Nonnull
@ReturnsMutableCopy
public static XMLWriterSettings createForHTML5 ()
{
 return new XMLWriterSettings ().setSerializeVersion (EXMLSerializeVersion.HTML)
                 .setSerializeXMLDeclaration (EXMLSerializeXMLDeclaration.IGNORE)
                 .setIndentDeterminator (new XMLIndentDeterminatorHTML ())
                 .setBracketModeDeterminator (new XMLBracketModeDeterminatorHTML5 ())
                 .setSpaceOnSelfClosedElement (true)
                 .setPutNamespaceContextPrefixesInRoot (true);
}

代码示例来源:origin: phax/ph-schematron

});
final XMLWriterSettings aXWS = new XMLWriterSettings ();
aXWS.setNamespaceContext (aNSContext).setPutNamespaceContextPrefixesInRoot (true);

代码示例来源:origin: com.helger/ph-jaxb

/**
 * @return The XML writer settings to be used based on this writer settings.
 *         Never <code>null</code>.
 */
@Nonnull
default IXMLWriterSettings getXMLWriterSettings ()
{
 final XMLWriterSettings ret = new XMLWriterSettings ().setNamespaceContext (getNamespaceContext ())
                            .setIndent (isFormattedOutput () ? EXMLSerializeIndent.INDENT_AND_ALIGN
                                             : EXMLSerializeIndent.NONE);
 if (hasIndentString ())
  ret.setIndentationString (getIndentString ());
 if (hasCharset ())
  ret.setCharset (getCharset ());
 return ret.setNewLineMode (ENewLineMode.DEFAULT)
      .setIncorrectCharacterHandling (EXMLIncorrectCharacterHandling.DO_NOT_WRITE_LOG_WARNING);
}

代码示例来源:origin: phax/ph-schematron

new PSWriter (new PSWriterSettings ().setXMLWriterSettings (new XMLWriterSettings ())).writeToFile (aPreprocessedSchema,
                                                  m_aDstFile);
log ("Successfully pre-processed Schematron " + m_aSrcFile + " to " + m_aDstFile);

代码示例来源:origin: com.helger/ph-xml

return new XMLWriterSettings ().setSerializeVersion (EXMLSerializeVersion.XML_10)
                .setSerializeXMLDeclaration (EXMLSerializeXMLDeclaration.IGNORE)
                .setSerializeDocType (EXMLSerializeDocType.IGNORE)

代码示例来源:origin: com.helger/ph-as4-servlet

AS4HttpDebug.debug ( () -> "SEND-RESPONSE [async sent] received: " +
               XMLWriter.getNodeAsString (aAsyncResponse,
                            new XMLWriterSettings ().setIndent (EXMLSerializeIndent.NONE)));
});

相关文章