Class CommonConfig

  • Direct Known Subclasses:
    ReaderConfig, WriterConfig

    public abstract class CommonConfig
    extends java.lang.Object
    Base class for reader and writer-side configuration/context objects
    • Field Summary

      Fields 
      Modifier and Type Field 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 java.lang.String IMPL_NAME  
      protected static java.lang.String IMPL_VERSION
      This is "major.minor" version used for purposes of determining the feature set.
      (package private) static int PROP_IMPL_NAME  
      (package private) static int PROP_IMPL_VERSION  
      (package private) static int PROP_SUPPORTS_XML11  
      (package private) static int PROP_SUPPORTS_XMLID  
      (package private) static java.util.HashMap<java.lang.String,​java.lang.Integer> sStdProperties
      Map to use for converting from String property ids to enumeration (ints).
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CommonConfig​(int flags, int flagMods)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String getActualEncoding()  
      abstract java.lang.String getExternalEncoding()
      This method returns name of encoding that has been passed explicitly to the reader or writer, from outside.
      java.lang.Object getProperty​(java.lang.String propName, boolean isMandatory)  
      protected boolean hasExplicitFlag​(int flagMask)  
      protected boolean hasFlag​(int flagMask)  
      protected 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.
      boolean isPropertySupported​(java.lang.String propName)  
      abstract boolean isXml11()  
      protected void setFlag​(int flagMask, boolean state)  
      boolean setProperty​(java.lang.String propName, java.lang.Object value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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
      • 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.
      • _flags

        protected int _flags
        Bitset for all on/off values for this configuration object.
      • _flagMods

        protected int _flagMods
        Bitset that indicates all explicit changes to on/off values; clear bits indicate settings that are unmodified default values.
    • Constructor Detail

      • CommonConfig

        protected CommonConfig​(int flags,
                               int flagMods)
    • Method Detail

      • getProperty

        public java.lang.Object getProperty​(java.lang.String propName,
                                            boolean isMandatory)
        Parameters:
        isMandatory - If true, unrecognized property should result in IllegalArgumentException
      • 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 succesfully set to specified value; false if its value was not changed
      • getExternalEncoding

        public abstract java.lang.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:
        Encoding that has been passed externally by the application
      • getActualEncoding

        public abstract java.lang.String getActualEncoding()
        Returns:
        Actual encoding in use, as determined by the processor.
      • isXml11

        public abstract boolean isXml11()
        Returns:
        True, if the processing will be done according to Xml 1.1 rules; false if according to xml 1.0
      • hasFlag

        protected final boolean hasFlag​(int flagMask)
      • hasExplicitFlag

        protected final boolean hasExplicitFlag​(int flagMask)
      • setFlag

        protected final void setFlag​(int flagMask,
                                     boolean state)
      • hasFlagBeenModified

        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:
        False, if flag in question has its default value, true if a call has been made that could have changed it.