Package com.ctc.wstx.api
Class CommonConfig
- java.lang.Object
-
- com.ctc.wstx.api.CommonConfig
-
- All Implemented Interfaces:
org.codehaus.stax2.XMLStreamProperties
- Direct Known Subclasses:
ReaderConfig,ValidatorConfig,WriterConfig
abstract class CommonConfig extends java.lang.Object implements org.codehaus.stax2.XMLStreamPropertiesShared common base class for variour configuration container implementations for public factories Woodstox uses: implementations ofXMLInputFactory,XMLOutputFactoryandXMLValidationSchemaFactory. Implements basic settings for some shared settings, defined by the shared property interfaceXMLStreamProperties.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intCPROP_IMPL_NAME(package private) static intCPROP_IMPL_VERSION(package private) static intCPROP_RETURN_NULL_FOR_DEFAULT_NAMESPACE(package private) static intCPROP_SUPPORT_XMLID(package private) static intCPROP_SUPPORTS_XML11protected static java.lang.StringIMPL_NAMEprotected static java.lang.StringIMPL_VERSIONThis is "major.minor" version used for purposes of determining the feature set.protected booleanmReturnNullForDefaultNamespaceAs per [WSTX-277], can specify whether prefix for the "default namespace" is return as null (true) or empty String (false)(package private) static java.util.HashMap<java.lang.String,java.lang.Integer>sStdPropertiesMap to use for converting from String property ids to enumeration (ints).
-
Constructor Summary
Constructors Modifier Constructor Description protectedCommonConfig(CommonConfig base)Constructor used by sub-classes
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleandoesSupportXml11()booleandoesSupportXmlId()protected abstract intfindPropertyId(java.lang.String propName)protected intfindStdPropertyId(java.lang.String propName)static java.lang.StringgetImplName()Method used to figure out the official implementation name for input/output/validation factories.static java.lang.StringgetImplVersion()Method used to figure out the official implementation version for input/output/validation factories.protected abstract java.lang.ObjectgetProperty(int id)java.lang.ObjectgetProperty(java.lang.String propName)protected java.lang.ObjectgetStdProperty(int id)booleanisPropertySupported(java.lang.String propName)protected voidreportUnknownProperty(java.lang.String propName)booleanreturnNullForDefaultNamespace()java.lang.ObjectsafeGetProperty(java.lang.String propName)protected abstract booleansetProperty(java.lang.String propName, int id, java.lang.Object value)booleansetProperty(java.lang.String propName, java.lang.Object value)protected booleansetStdProperty(java.lang.String propName, int id, java.lang.Object value)
-
-
-
Field Detail
-
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
This is "major.minor" version used for purposes of determining the feature set. Patch level is not included, since those should not affect API or feature set. Using applications should be prepared to take additional levels, however, just not depend on those being available.- See Also:
- Constant Field Values
-
CPROP_IMPL_NAME
static final int CPROP_IMPL_NAME
- See Also:
- Constant Field Values
-
CPROP_IMPL_VERSION
static final int CPROP_IMPL_VERSION
- See Also:
- Constant Field Values
-
CPROP_SUPPORTS_XML11
static final int CPROP_SUPPORTS_XML11
- See Also:
- Constant Field Values
-
CPROP_SUPPORT_XMLID
static final int CPROP_SUPPORT_XMLID
- See Also:
- Constant Field Values
-
CPROP_RETURN_NULL_FOR_DEFAULT_NAMESPACE
static final int CPROP_RETURN_NULL_FOR_DEFAULT_NAMESPACE
- See Also:
- Constant Field Values
-
sStdProperties
static final java.util.HashMap<java.lang.String,java.lang.Integer> sStdProperties
Map to use for converting from String property ids to enumeration (ints). Used for faster dispatching.
-
mReturnNullForDefaultNamespace
protected boolean mReturnNullForDefaultNamespace
As per [WSTX-277], can specify whether prefix for the "default namespace" is return as null (true) or empty String (false)
-
-
Constructor Detail
-
CommonConfig
protected CommonConfig(CommonConfig base)
Constructor used by sub-classes- Parameters:
base- Base instance to copy settings from, if any; null for 'root' configuration objects.
-
-
Method Detail
-
getProperty
public java.lang.Object getProperty(java.lang.String propName)
-
isPropertySupported
public boolean isPropertySupported(java.lang.String propName)
-
setProperty
public boolean setProperty(java.lang.String propName, java.lang.Object value)- Returns:
- True, if the specified property was successfully set to specified value; false if its value was not changed
-
reportUnknownProperty
protected void reportUnknownProperty(java.lang.String propName)
-
safeGetProperty
public final java.lang.Object safeGetProperty(java.lang.String propName)
-
getImplName
public static java.lang.String getImplName()
Method used to figure out the official implementation name for input/output/validation factories.
-
getImplVersion
public static java.lang.String getImplVersion()
Method used to figure out the official implementation version for input/output/validation factories.
-
findPropertyId
protected abstract 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.
-
doesSupportXml11
public boolean doesSupportXml11()
-
doesSupportXmlId
public boolean doesSupportXmlId()
-
returnNullForDefaultNamespace
public boolean returnNullForDefaultNamespace()
-
getProperty
protected abstract java.lang.Object getProperty(int id)
-
setProperty
protected abstract boolean setProperty(java.lang.String propName, int id, java.lang.Object value)
-
findStdPropertyId
protected int findStdPropertyId(java.lang.String propName)
-
setStdProperty
protected boolean setStdProperty(java.lang.String propName, int id, java.lang.Object value)- Parameters:
propName- Name of standard property to setid- Internal id matching the namevalue- Value to set the standard property to
-
getStdProperty
protected java.lang.Object getStdProperty(int id)
-
-