本文整理了Java中com.helger.xml.serialize.write.XMLWriterSettings.setIncorrectCharacterHandling()
方法的一些代码示例,展示了XMLWriterSettings.setIncorrectCharacterHandling()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLWriterSettings.setIncorrectCharacterHandling()
方法的具体详情如下:
包路径:com.helger.xml.serialize.write.XMLWriterSettings
类名称: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 ());
}
内容来源于网络,如有侵权,请联系作者删除!