Top Description Fields Constructors Methods
com.fasterxml.aalto.impl

public abstract Class CommonConfig

extends Object
Class Inheritance
Known Direct Subclasses
com.fasterxml.aalto.in.ReaderConfig, com.fasterxml.aalto.out.WriterConfig
Imports
java.util.*, org.codehaus.stax2.XMLStreamProperties

Base class for reader and writer-side configuration/context objects

Field Summary

Modifier and TypeField and Description
protected int
_flagMods

Bitset that indicates all explicit changes to on/off values; clear bits indicate settings that are unmodified default values.

protected int
_flags

Bitset for all on/off values for this configuration object.

protected static final String
protected static final String
IMPL_VERSION

This is "major.minor" version used for purposes of determining the feature set.

pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final HashMap<String, Integer>
sStdProperties

Map to use for converting from String property ids to enumeration (ints).

Constructor Summary

AccessConstructor and Description
protected
CommonConfig(int flags, int flagMods)

Method Summary

Modifier and TypeMethod and Description
public abstract String

Returns:

Actual encoding in use, as determined by the processor.
getActualEncoding
()

public abstract String

Returns:

Encoding that has been passed externally by the application
getExternalEncoding
()

This method returns name of encoding that has been passed explicitly to the reader or writer, from outside.

public Object
getProperty(String propName, boolean
If true, unrecognized property should result in IllegalArgumentException
isMandatory
)

protected final boolean
hasExplicitFlag(int flagMask)

protected final boolean
hasFlag(int flagMask)

protected final boolean

Returns:

False, if flag in question has its default value, true if a call has been made that could have changed it.
hasFlagBeenModified
(int flagMask)

Method for checking whether specific configuration flag has been explicitly modified (set, clear; regardless of whether state actually changed), or is it the default value.

public boolean
public abstract boolean

Returns:

True, if the processing will be done according to Xml 1.1 rules; false if according to xml 1.0
isXml11
()

protected final void
setFlag(int flagMask, boolean state)

public boolean

Returns:

True, if the specified property was succesfully set to specified value; false if its value was not changed
setProperty
(String propName, Object value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_flagModsback to summary
protected int _flagMods

Bitset that indicates all explicit changes to on/off values; clear bits indicate settings that are unmodified default values.

_flagsback to summary
protected int _flags

Bitset for all on/off values for this configuration object.

IMPL_NAMEback to summary
protected static final String IMPL_NAME
IMPL_VERSIONback to summary
protected static final 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.

PROP_IMPL_NAMEback to summary
pack-priv static final int PROP_IMPL_NAME
PROP_IMPL_VERSIONback to summary
pack-priv static final int PROP_IMPL_VERSION
PROP_SUPPORTS_XML11back to summary
pack-priv static final int PROP_SUPPORTS_XML11
PROP_SUPPORTS_XMLIDback to summary
pack-priv static final int PROP_SUPPORTS_XMLID
sStdPropertiesback to summary
pack-priv static final HashMap<String, Integer> sStdProperties

Map to use for converting from String property ids to enumeration (ints). Used for faster dispatching.

Constructor Detail

CommonConfigback to summary
protected CommonConfig(int flags, int flagMods)

Method Detail

getActualEncodingback to summary
public abstract String getActualEncoding()
Returns:String

Actual encoding in use, as determined by the processor.

getExternalEncodingback to summary
public abstract String getExternalEncoding()

This method returns name of encoding that has been passed explicitly to the reader or writer, from outside. An example is that HTTP server may pass encoding as declared in HTTP headers. This should either be null (if none passed), or the same as actual encoding (which is determined from physical stream contents [for readers], or from encoder properties / configuration [for writers]

Returns:String

Encoding that has been passed externally by the application

getPropertyback to summary
public Object getProperty(String propName, boolean isMandatory)
Parameters
isMandatory:boolean

If true, unrecognized property should result in IllegalArgumentException

hasExplicitFlagback to summary
protected final boolean hasExplicitFlag(int flagMask)
hasFlagback to summary
protected final boolean hasFlag(int flagMask)
hasFlagBeenModifiedback to summary
protected final boolean hasFlagBeenModified(int flagMask)

Method for checking whether specific configuration flag has been explicitly modified (set, clear; regardless of whether state actually changed), or is it the default value.

Returns:boolean

False, if flag in question has its default value, true if a call has been made that could have changed it.

isPropertySupportedback to summary
public boolean isPropertySupported(String propName)
isXml11back to summary
public abstract boolean isXml11()
Returns:boolean

True, if the processing will be done according to Xml 1.1 rules; false if according to xml 1.0

setFlagback to summary
protected final void setFlag(int flagMask, boolean state)
setPropertyback to summary
public boolean setProperty(String propName, Object value)
Returns:boolean

True, if the specified property was succesfully set to specified value; false if its value was not changed