com.ctc.wstx.api
Class WriterConfig

java.lang.Object
  extended by com.ctc.wstx.api.WriterConfig
All Implemented Interfaces:
OutputConfigFlags, XMLStreamProperties

public final class WriterConfig
extends java.lang.Object
implements OutputConfigFlags

Simple configuration container class; passed by reader factory to reader instance created.


Field Summary
protected static java.lang.String DEFAULT_AUTOMATIC_NS_PREFIX
           
protected static java.lang.String IMPL_NAME
           
protected static java.lang.String IMPL_VERSION
           
protected  EscapingWriterFactory mAttrValueEscaperFactory
           
protected  java.lang.String mAutoNsPrefix
           
protected  int mConfigFlags
           
protected  javax.xml.stream.XMLReporter mProblemReporter
           
protected  EscapingWriterFactory mTextEscaperFactory
           
 
Fields inherited from interface com.ctc.wstx.cfg.OutputConfigFlags
CFG_AUTOMATIC_EMPTY_ELEMS, CFG_AUTOMATIC_NS, CFG_COPY_DEFAULT_ATTRS, CFG_ENABLE_NS, CFG_ESCAPE_CR, CFG_FIX_CONTENT, CFG_OUTPUT_CDATA_AS_TEXT, CFG_VALIDATE_ATTR, CFG_VALIDATE_CONTENT, CFG_VALIDATE_NAMES, CFG_VALIDATE_STRUCTURE
 
Fields inherited from interface org.codehaus.stax2.XMLStreamProperties
XSP_IMPLEMENTATION_NAME, XSP_IMPLEMENTATION_VERSION, XSP_NAMESPACE_AWARE, XSP_PROBLEM_REPORTER, XSP_SUPPORT_XMLID, XSP_SUPPORTS_XML11, XSP_V_XMLID_FULL, XSP_V_XMLID_NONE, XSP_V_XMLID_TYPING
 
Method Summary
 byte[] allocFullBBuffer(int minSize)
           
 char[] allocFullCBuffer(int minSize)
           
 char[] allocMediumCBuffer(int minSize)
          Method called to allocate intermediate recyclable copy buffers
 boolean automaticEmptyElementsEnabled()
           
 boolean automaticNamespacesEnabled()
           
 void configureForRobustness()
          For Woodstox, this profile enables all basic well-formedness checks, including checking for name validity, and also enables all matching "fix-me" properties (currently only content-fixing property exists).
 void configureForSpeed()
          For Woodstox, setting this profile disables most checks for validity; specifically anything that can have measurable performance impact.
 void configureForXmlConformance()
          For Woodstox, this profile enables all basic well-formedness checks, including checking for name validity.
static WriterConfig createFullDefaults()
           
static WriterConfig createJ2MEDefaults()
           
 WriterConfig createNonShared()
           
 void doCopyDefaultAttrs(boolean state)
           
 void doEscapeCr(boolean state)
           
protected  boolean doesSupportXml11()
           
 void doFixContent(boolean state)
           
 void doOutputCDataAsText(boolean state)
           
 void doSupportNamespaces(boolean state)
           
 void doValidateAttributes(boolean state)
           
 void doValidateContent(boolean state)
           
 void doValidateNames(boolean state)
           
 void doValidateStructure(boolean state)
           
 void enableAutomaticEmptyElements(boolean state)
           
 void enableAutomaticNamespaces(boolean state)
           
protected  int findPropertyId(java.lang.String propName)
           
protected  int findStdPropertyId(java.lang.String propName)
           
 void freeFullBBuffer(byte[] buffer)
           
 void freeFullCBuffer(char[] buffer)
           
 void freeMediumCBuffer(char[] buffer)
           
 EscapingWriterFactory getAttrValueEscaperFactory()
           
 java.lang.String getAutomaticNsPrefix()
           
 int getConfigFlags()
           
 javax.xml.stream.XMLReporter getProblemReporter()
           
 java.lang.Object getProperty(int id)
           
 java.lang.Object getProperty(java.lang.String propName)
           
protected  java.lang.Object getStdProperty(int id)
           
 EscapingWriterFactory getTextEscaperFactory()
           
 boolean isPropertySupported(java.lang.String propName)
           
 void setAttrValueEscaperFactory(EscapingWriterFactory f)
           
 void setAutomaticNsPrefix(java.lang.String prefix)
           
 void setProblemReporter(javax.xml.stream.XMLReporter rep)
           
 boolean setProperty(java.lang.String name, int id, java.lang.Object value)
           
 boolean setProperty(java.lang.String propName, java.lang.Object value)
           
protected  boolean setStdProperty(java.lang.String propName, int id, java.lang.Object value)
           
 void setTextEscaperFactory(EscapingWriterFactory f)
           
 boolean willCopyDefaultAttrs()
           
 boolean willEscapeCr()
           
 boolean willFixContent()
           
 boolean willOutputCDataAsText()
           
 boolean willSupportNamespaces()
           
 boolean willValidateAttributes()
           
 boolean willValidateContent()
           
 boolean willValidateNames()
           
 boolean willValidateStructure()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_AUTOMATIC_NS_PREFIX

protected static final java.lang.String DEFAULT_AUTOMATIC_NS_PREFIX
See Also:
Constant Field Values

mConfigFlags

protected int mConfigFlags

mAutoNsPrefix

protected java.lang.String mAutoNsPrefix

mTextEscaperFactory

protected EscapingWriterFactory mTextEscaperFactory

mAttrValueEscaperFactory

protected EscapingWriterFactory mAttrValueEscaperFactory

mProblemReporter

protected javax.xml.stream.XMLReporter mProblemReporter

IMPL_NAME

protected static final java.lang.String IMPL_NAME
See Also:
Constant Field Values

IMPL_VERSION

protected static final java.lang.String IMPL_VERSION
See Also:
Constant Field Values
Method Detail

createJ2MEDefaults

public static WriterConfig createJ2MEDefaults()

createFullDefaults

public static WriterConfig createFullDefaults()

createNonShared

public WriterConfig createNonShared()

findPropertyId

protected int findPropertyId(java.lang.String propName)
Returns:
Internal enumerated int matching the String name of the property, if one found: -1 to indicate no match was found.

getProperty

public java.lang.Object getProperty(int id)

setProperty

public boolean setProperty(java.lang.String name,
                           int id,
                           java.lang.Object value)
Returns:
True, if the specified property was succesfully set to specified value; false if its value was not changed

getConfigFlags

public int getConfigFlags()

automaticNamespacesEnabled

public boolean automaticNamespacesEnabled()

automaticEmptyElementsEnabled

public boolean automaticEmptyElementsEnabled()

willSupportNamespaces

public boolean willSupportNamespaces()

willOutputCDataAsText

public boolean willOutputCDataAsText()

willCopyDefaultAttrs

public boolean willCopyDefaultAttrs()

willEscapeCr

public boolean willEscapeCr()

willValidateStructure

public boolean willValidateStructure()

willValidateContent

public boolean willValidateContent()

willValidateAttributes

public boolean willValidateAttributes()

willValidateNames

public boolean willValidateNames()

willFixContent

public boolean willFixContent()

getAutomaticNsPrefix

public java.lang.String getAutomaticNsPrefix()
Returns:
Prefix to use as the base for automatically generated namespace prefixes ("namespace prefix prefix", so to speak). Defaults to "wstxns".

getTextEscaperFactory

public EscapingWriterFactory getTextEscaperFactory()

getAttrValueEscaperFactory

public EscapingWriterFactory getAttrValueEscaperFactory()

getProblemReporter

public javax.xml.stream.XMLReporter getProblemReporter()

enableAutomaticNamespaces

public void enableAutomaticNamespaces(boolean state)

enableAutomaticEmptyElements

public void enableAutomaticEmptyElements(boolean state)

doSupportNamespaces

public void doSupportNamespaces(boolean state)

doOutputCDataAsText

public void doOutputCDataAsText(boolean state)

doCopyDefaultAttrs

public void doCopyDefaultAttrs(boolean state)

doEscapeCr

public void doEscapeCr(boolean state)

doValidateStructure

public void doValidateStructure(boolean state)

doValidateContent

public void doValidateContent(boolean state)

doValidateAttributes

public void doValidateAttributes(boolean state)

doValidateNames

public void doValidateNames(boolean state)

doFixContent

public void doFixContent(boolean state)

setAutomaticNsPrefix

public void setAutomaticNsPrefix(java.lang.String prefix)
Parameters:
prefix - Prefix to use as the base for automatically generated namespace prefixes ("namespace prefix prefix", so to speak).

setTextEscaperFactory

public void setTextEscaperFactory(EscapingWriterFactory f)

setAttrValueEscaperFactory

public void setAttrValueEscaperFactory(EscapingWriterFactory f)

setProblemReporter

public void setProblemReporter(javax.xml.stream.XMLReporter rep)

configureForXmlConformance

public void configureForXmlConformance()
For Woodstox, this profile enables all basic well-formedness checks, including checking for name validity.


configureForRobustness

public void configureForRobustness()
For Woodstox, this profile enables all basic well-formedness checks, including checking for name validity, and also enables all matching "fix-me" properties (currently only content-fixing property exists).


configureForSpeed

public void configureForSpeed()
For Woodstox, setting this profile disables most checks for validity; specifically anything that can have measurable performance impact.


allocMediumCBuffer

public char[] allocMediumCBuffer(int minSize)
Method called to allocate intermediate recyclable copy buffers


freeMediumCBuffer

public void freeMediumCBuffer(char[] buffer)

allocFullCBuffer

public char[] allocFullCBuffer(int minSize)

freeFullCBuffer

public void freeFullCBuffer(char[] buffer)

allocFullBBuffer

public byte[] allocFullBBuffer(int minSize)

freeFullBBuffer

public void freeFullBBuffer(byte[] buffer)

getProperty

public final java.lang.Object getProperty(java.lang.String propName)

isPropertySupported

public final boolean isPropertySupported(java.lang.String propName)

setProperty

public final boolean setProperty(java.lang.String propName,
                                 java.lang.Object value)
Returns:
True, if the specified property was succesfully set to specified value; false if its value was not changed

doesSupportXml11

protected boolean doesSupportXml11()

findStdPropertyId

protected int findStdPropertyId(java.lang.String propName)

setStdProperty

protected boolean setStdProperty(java.lang.String propName,
                                 int id,
                                 java.lang.Object value)

getStdProperty

protected java.lang.Object getStdProperty(int id)