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

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

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

XMLWriterSettings.setIncorrectCharacterHandling介绍

[英]Set the way how to handle invalid characters.
[中]设置处理无效字符的方式。

代码示例

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

@Nonnull
public HCConversionSettings setXMLWriterSettingsOptimized (final boolean bOptimized)
{
 m_aXMLWriterSettings.setIndent (bOptimized ? EXMLSerializeIndent.NONE
                       : DEFAULT_INDENT_AND_ALIGN_HTML ? EXMLSerializeIndent.INDENT_AND_ALIGN
                                       : EXMLSerializeIndent.NONE);
 // WRITE_TO_FILE_NO_LOG is the quickest version
 m_aXMLWriterSettings.setIncorrectCharacterHandling (bOptimized ? EXMLIncorrectCharacterHandling.WRITE_TO_FILE_NO_LOG
                                 : EXMLIncorrectCharacterHandling.DO_NOT_WRITE_LOG_WARNING);
 return this;
}

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

@Nonnull
public static XMLWriterSettings createDefaultXMLWriterSettings (@Nonnull final EHTMLVersion eHTMLVersion)
{
 final XMLWriterSettings ret = eHTMLVersion.isAtLeastHTML5 () ? XMLWriterSettings.createForHTML5 ()
                                : XMLWriterSettings.createForXHTML ();
 return ret.setIncorrectCharacterHandling (EXMLIncorrectCharacterHandling.DO_NOT_WRITE_LOG_WARNING)
      .setIndent (DEFAULT_INDENT_AND_ALIGN_HTML ? EXMLSerializeIndent.INDENT_AND_ALIGN
                           : EXMLSerializeIndent.NONE);
}

代码示例来源: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: com.helger/ph-xml

/**
 * Copy constructor.
 *
 * @param aOther
 *        The object to copy the settings from. May not be <code>null</code>.
 */
public XMLWriterSettings (@Nonnull final IXMLWriterSettings aOther)
{
 ValueEnforcer.notNull (aOther, "Other");
 setSerializeVersion (aOther.getSerializeVersion ());
 setSerializeXMLDeclaration (aOther.getSerializeXMLDeclaration ());
 setSerializeDocType (aOther.getSerializeDocType ());
 setSerializeComments (aOther.getSerializeComments ());
 setIndent (aOther.getIndent ());
 setIndentDeterminator (aOther.getIndentDeterminator ());
 setIncorrectCharacterHandling (aOther.getIncorrectCharacterHandling ());
 setCharset (aOther.getCharset ());
 setNamespaceContext (aOther.getNamespaceContext ());
 setBracketModeDeterminator (aOther.getBracketModeDeterminator ());
 setUseDoubleQuotesForAttributes (aOther.isUseDoubleQuotesForAttributes ());
 setSpaceOnSelfClosedElement (aOther.isSpaceOnSelfClosedElement ());
 setNewLineMode (aOther.getNewLineMode ());
 setIndentationString (aOther.getIndentationString ());
 setEmitNamespaces (aOther.isEmitNamespaces ());
 setPutNamespaceContextPrefixesInRoot (aOther.isPutNamespaceContextPrefixesInRoot ());
 setWriteCDATAAsText (aOther.isWriteCDATAAsText ());
 setOrderAttributesAndNamespaces (aOther.isOrderAttributesAndNamespaces ());
}

相关文章