gpt4 book ai didi

com.ctc.wstx.api.WriterConfig类的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 00:59:05 30 4
gpt4 key购买 nike

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

WriterConfig介绍

[英]Simple configuration container class; passed by writer factory to writer instance created.
[中]简单配置容器类;由编写器工厂传递给已创建的编写器实例。

代码示例

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

public static WriterConfig createJ2MEDefaults()
{
  return new WriterConfig(null, true, DEFAULT_FLAGS_J2ME, null);
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

public EncodingXmlWriter(OutputStream out, WriterConfig cfg, String encoding,
             boolean autoclose)
  throws IOException
{
  super(cfg, encoding, autoclose);
  mOut = out;
  mOutputBuffer = cfg.allocFullBBuffer(DEFAULT_BUFFER_SIZE);
  mOutputPtr = 0;
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

/**
 * @param outs Underlying OutputStream that the writer
 *    (<code>out</code>) is using, if known. Needed to support
 *    (optional) access to the underlying stream
 */
public BufferingXmlWriter(Writer out, WriterConfig cfg, String enc,
             boolean autoclose,
             OutputStream outs, int bitsize)
  throws IOException
{
  super(cfg, enc, autoclose);
  mOut = out;
  mOutputBuffer = cfg.allocFullCBuffer(DEFAULT_BUFFER_SIZE);
  mOutputBufLen = mOutputBuffer.length;
  mSmallWriteSize = DEFAULT_SMALL_SIZE;
  mOutputPtr = 0;
  mUnderlyingStream = outs;
  // Let's use double-quotes, as usual; alternative is apostrophe
  mEncQuoteChar = '"';
  mEncQuoteEntity = "&quot;";
  /* Note: let's actually exclude couple of illegal chars for
   * unicode-based encoders. But we do not have to worry about
   * surrogates quite here, fortunately.
   */
  if (bitsize < 1) {
    bitsize = guessEncodingBitSize(enc);
  }
  mEncHighChar = ((bitsize < 16) ? (1 << bitsize) : 0xFFFE);
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

return automaticNamespacesEnabled() ? Boolean.TRUE : Boolean.FALSE;
  return willSupportNamespaces() ? Boolean.TRUE : Boolean.FALSE;
case PROP_PROBLEM_REPORTER:
  return getProblemReporter();
  return automaticEmptyElementsEnabled() ? Boolean.TRUE : Boolean.FALSE;
case PROP_AUTO_CLOSE_OUTPUT:
  return willAutoCloseOutput() ? Boolean.TRUE : Boolean.FALSE;
case PROP_AUTOMATIC_NS_PREFIX:
  return getAutomaticNsPrefix();
case PROP_TEXT_ESCAPER:
  return getTextEscaperFactory();
case PROP_ATTR_VALUE_ESCAPER:
  return getAttrValueEscaperFactory();
  return willUseDoubleQuotesInXmlDecl() ? Boolean.TRUE : Boolean.FALSE;
case PROP_OUTPUT_CDATA_AS_TEXT:
  return willOutputCDataAsText() ? Boolean.TRUE : Boolean.FALSE;
case PROP_COPY_DEFAULT_ATTRS:
  return willCopyDefaultAttrs() ? Boolean.TRUE : Boolean.FALSE;
case PROP_ESCAPE_CR:
  return willEscapeCr() ? Boolean.TRUE : Boolean.FALSE;
case PROP_ADD_SPACE_AFTER_EMPTY_ELEM:
  return willAddSpaceAfterEmptyElem() ? Boolean.TRUE : Boolean.FALSE;
case PROP_AUTOMATIC_END_ELEMENTS:
  return automaticEndElementsEnabled() ? Boolean.TRUE : Boolean.FALSE;
  return willValidateStructure() ? Boolean.TRUE : Boolean.FALSE;

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

/**
 * Called by {@link #createSW(OutputStream, Writer, String, boolean)} after all of the nessesary configuration
 * logic is complete.
 */
protected XMLStreamWriter2 createSW(String enc, WriterConfig cfg, XmlWriter xw) {
  if (cfg.willSupportNamespaces()) {
    if (cfg.automaticNamespacesEnabled()) {
      return new RepairingNsStreamWriter(xw, enc, cfg);
    }
    return new SimpleNsStreamWriter(xw, enc, cfg);
  }
  return new NonNsStreamWriter(xw, enc, cfg);
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

private WstxDOMWrappingWriter(WriterConfig cfg, Node treeRoot)
  throws XMLStreamException
{
  super(treeRoot, cfg.willSupportNamespaces(), cfg.automaticNamespacesEnabled());
  mConfig = cfg;
  mAutoNsSeq = null;
  mAutomaticNsPrefix = mNsRepairing ? mConfig.getAutomaticNsPrefix() : null;
  /* Ok; we need a document node; or an element node; or a document
   * fragment node.
   */
  switch (treeRoot.getNodeType()) {
  case Node.DOCUMENT_NODE:
  case Node.DOCUMENT_FRAGMENT_NODE:
    // both are ok, but no current element
    mCurrElem = DOMOutputElement.createRoot(treeRoot);
    mOpenElement = null;
    break;
  case Node.ELEMENT_NODE: // can make sub-tree... ok
    {
      // still need a virtual root node as parent
      DOMOutputElement root = DOMOutputElement.createRoot(treeRoot);
      Element elem = (Element) treeRoot;
      mOpenElement = mCurrElem = root.createChild(elem);
    }
    break;
  default: // other Nodes not usable
    throw new XMLStreamException("Can not create an XMLStreamWriter for a DOM node of type "+treeRoot.getClass());
  }
}

代码示例来源:origin: woodstox/wstx-asl

return automaticNamespacesEnabled() ? Boolean.TRUE : Boolean.FALSE;
  return willSupportNamespaces() ? Boolean.TRUE : Boolean.FALSE;
case PROP_PROBLEM_REPORTER:
  return getProblemReporter();
  return automaticEmptyElementsEnabled() ? Boolean.TRUE : Boolean.FALSE;
case PROP_AUTOMATIC_NS_PREFIX:
  return getAutomaticNsPrefix();
case PROP_TEXT_ESCAPER:
  return getTextEscaperFactory();
case PROP_ATTR_VALUE_ESCAPER:
  return getAttrValueEscaperFactory();
  return willOutputCDataAsText() ? Boolean.TRUE : Boolean.FALSE;
case PROP_COPY_DEFAULT_ATTRS:
  return willCopyDefaultAttrs() ? Boolean.TRUE : Boolean.FALSE;
case PROP_ESCAPE_CR:
  return willEscapeCr() ? Boolean.TRUE : Boolean.FALSE;
  return willValidateStructure() ? Boolean.TRUE : Boolean.FALSE;
case PROP_VALIDATE_CONTENT:
  return willValidateContent() ? Boolean.TRUE : Boolean.FALSE;
case PROP_VALIDATE_ATTR:
  return willValidateAttributes() ? Boolean.TRUE : Boolean.FALSE;
case PROP_VALIDATE_NAMES:
  return willValidateNames() ? Boolean.TRUE : Boolean.FALSE;
case PROP_FIX_CONTENT:
  return willFixContent() ? Boolean.TRUE : Boolean.FALSE;

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

protected final char[] getCopyBuffer()
{
  char[] buf = mCopyBuffer;
  if (buf == null) {
    mCopyBuffer = buf = mConfig.allocMediumCBuffer(DEFAULT_COPYBUFFER_LEN);
  }
  return buf;
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

public void configureForXmlConformance()
{
  mConfig.configureForXmlConformance();
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

public void configureForSpeed()
{
  mConfig.configureForSpeed();
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

public void configureForRobustness()
{
  mConfig.configureForRobustness();
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

public WstxOutputFactory() {
  mConfig = WriterConfig.createFullDefaults();
}

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

return automaticNamespacesEnabled() ? Boolean.TRUE : Boolean.FALSE;
  return willSupportNamespaces() ? Boolean.TRUE : Boolean.FALSE;
case PROP_PROBLEM_REPORTER:
  return getProblemReporter();
  return automaticEmptyElementsEnabled() ? Boolean.TRUE : Boolean.FALSE;
case PROP_AUTO_CLOSE_OUTPUT:
  return willAutoCloseOutput() ? Boolean.TRUE : Boolean.FALSE;
case PROP_AUTOMATIC_NS_PREFIX:
  return getAutomaticNsPrefix();
case PROP_TEXT_ESCAPER:
  return getTextEscaperFactory();
case PROP_ATTR_VALUE_ESCAPER:
  return getAttrValueEscaperFactory();
  return willUseDoubleQuotesInXmlDecl() ? Boolean.TRUE : Boolean.FALSE;
case PROP_OUTPUT_CDATA_AS_TEXT:
  return willOutputCDataAsText() ? Boolean.TRUE : Boolean.FALSE;
case PROP_COPY_DEFAULT_ATTRS:
  return willCopyDefaultAttrs() ? Boolean.TRUE : Boolean.FALSE;
case PROP_ESCAPE_CR:
  return willEscapeCr() ? Boolean.TRUE : Boolean.FALSE;
case PROP_ADD_SPACE_AFTER_EMPTY_ELEM:
  return willAddSpaceAfterEmptyElem() ? Boolean.TRUE : Boolean.FALSE;
case PROP_AUTOMATIC_END_ELEMENTS:
  return automaticEndElementsEnabled() ? Boolean.TRUE : Boolean.FALSE;
  return willValidateStructure() ? Boolean.TRUE : Boolean.FALSE;

代码示例来源:origin: woodstox/wstx-lgpl

return automaticNamespacesEnabled() ? Boolean.TRUE : Boolean.FALSE;
  return willSupportNamespaces() ? Boolean.TRUE : Boolean.FALSE;
case PROP_PROBLEM_REPORTER:
  return getProblemReporter();
  return automaticEmptyElementsEnabled() ? Boolean.TRUE : Boolean.FALSE;
case PROP_AUTOMATIC_NS_PREFIX:
  return getAutomaticNsPrefix();
case PROP_TEXT_ESCAPER:
  return getTextEscaperFactory();
case PROP_ATTR_VALUE_ESCAPER:
  return getAttrValueEscaperFactory();
  return willOutputCDataAsText() ? Boolean.TRUE : Boolean.FALSE;
case PROP_COPY_DEFAULT_ATTRS:
  return willCopyDefaultAttrs() ? Boolean.TRUE : Boolean.FALSE;
case PROP_ESCAPE_CR:
  return willEscapeCr() ? Boolean.TRUE : Boolean.FALSE;
  return willValidateStructure() ? Boolean.TRUE : Boolean.FALSE;
case PROP_VALIDATE_CONTENT:
  return willValidateContent() ? Boolean.TRUE : Boolean.FALSE;
case PROP_VALIDATE_ATTR:
  return willValidateAttributes() ? Boolean.TRUE : Boolean.FALSE;
case PROP_VALIDATE_NAMES:
  return willValidateNames() ? Boolean.TRUE : Boolean.FALSE;
case PROP_FIX_CONTENT:
  return willFixContent() ? Boolean.TRUE : Boolean.FALSE;

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl

private WstxDOMWrappingWriter(WriterConfig cfg, Node treeRoot)
  throws XMLStreamException
{
  super(treeRoot, cfg.willSupportNamespaces(), cfg.automaticNamespacesEnabled());
  mConfig = cfg;
  mAutoNsSeq = null;
  mAutomaticNsPrefix = mNsRepairing ? mConfig.getAutomaticNsPrefix() : null;
  /* Ok; we need a document node; or an element node; or a document
   * fragment node.
   */
  switch (treeRoot.getNodeType()) {
  case Node.DOCUMENT_NODE:
  case Node.DOCUMENT_FRAGMENT_NODE:
    // both are ok, but no current element
    mCurrElem = DOMOutputElement.createRoot(treeRoot);
    mOpenElement = null;
    break;
  case Node.ELEMENT_NODE: // can make sub-tree... ok
    {
      // still need a virtual root node as parent
      DOMOutputElement root = DOMOutputElement.createRoot(treeRoot);
      Element elem = (Element) treeRoot;
      mOpenElement = mCurrElem = root.createChild(elem);
    }
    break;
  default: // other Nodes not usable
    throw new XMLStreamException("Can not create an XMLStreamWriter for a DOM node of type "+treeRoot.getClass());
  }
}

代码示例来源:origin: Nextdoor/bender

/**
 * Called by {@link #createSW(OutputStream, Writer, String, boolean)} after all of the nessesary configuration
 * logic is complete.
 */
protected XMLStreamWriter2 createSW(String enc, WriterConfig cfg, XmlWriter xw) {
  if (cfg.willSupportNamespaces()) {
    if (cfg.automaticNamespacesEnabled()) {
      return new RepairingNsStreamWriter(xw, enc, cfg);
    }
    return new SimpleNsStreamWriter(xw, enc, cfg);
  }
  return new NonNsStreamWriter(xw, enc, cfg);
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

protected final char[] getCopyBuffer(int minLen)
{
  char[] buf = mCopyBuffer;
  if (buf == null || minLen > buf.length) {
    mCopyBuffer = buf = mConfig.allocMediumCBuffer(Math.max(DEFAULT_COPYBUFFER_LEN, minLen));
  }
  return buf;
}

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

@Override
public void configureForXmlConformance() {
  mConfig.configureForXmlConformance();
}

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

@Override
public void configureForSpeed() {
  mConfig.configureForSpeed();
}

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

@Override
public void configureForRobustness() {
  mConfig.configureForRobustness();
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com