| java.lang.Object org.geoserver.ows.util.EncodingInfo
EncodingInfo | public class EncodingInfo (Code) | | Xerces' getEncodingName() method of
org.apache.xerces.impl.XMLEntityManager )
returns an array with name of encoding scheme and endianness.
I decided to create a separate class incapsulating encoding metadata.
The may idea behind this is the fact that we will most probably need to
save this info somewhere and use it later when writing the response.
Beside that, using class makes related code more clear.
|
Constructor Summary | |
public | EncodingInfo() Non-arg constructor to use in a few cases when you need a blank
instance of EncodingInfo . | public | EncodingInfo(String encoding, Boolean isBigEndian) Constructor that takes name of the encoding scheme and endianness
- results of autodetection in getEncodingName .
BOM is considered missing if object is constructed this way.
Parameters: encoding - Name of the autodetected encoding scheme. Parameters: isBigEndian - Detected byte order of the data. | public | EncodingInfo(String encoding, Boolean isBigEndian, boolean hasBOM) Constructor that takes name of the encoding scheme and endianness
- results of autodetection in getEncodingName() .
Also presence of Byte Order Mark should be specified explicitly.
Parameters: encoding - Name of the autodetected encoding scheme. Parameters: isBigEndian - Detected byte order of the data. |
Method Summary | |
public void | copyFrom(EncodingInfo encInfo) Copies property values from another EncodingInfo instance.
Strange enough, but sometimes such behavior is preferred to simple
assignment or cloning. | public String | getEncoding() Returns current encoding scheme (or charset). | public boolean | hasBOM() Accessor for fHasBOM . | public Boolean | isBigEndian() Accessor for fIsBigEndian . | public void | setEncoding(String encoding) Sets new value of stored encoding (charset?) name. | public String | toString() Returns current state of this instance in human-readable form. |
EncodingInfo | public EncodingInfo()(Code) | | Non-arg constructor to use in a few cases when you need a blank
instance of EncodingInfo . It cant' be used right
after creation and should be populated first via either setters
or specific charset detection methods.
Parameters: encoding - Name of the autodetected encoding scheme. Parameters: isBigEndian - Detected byte order of the data. true iforder is big-endian, false if little-endian,and null if byte order is not relevant forthis encoding scheme. |
EncodingInfo | public EncodingInfo(String encoding, Boolean isBigEndian)(Code) | | Constructor that takes name of the encoding scheme and endianness
- results of autodetection in getEncodingName .
BOM is considered missing if object is constructed this way.
Parameters: encoding - Name of the autodetected encoding scheme. Parameters: isBigEndian - Detected byte order of the data. true iforder is big-endian, false if little-endian,and null if byte order is not relevant forthis encoding scheme. |
EncodingInfo | public EncodingInfo(String encoding, Boolean isBigEndian, boolean hasBOM)(Code) | | Constructor that takes name of the encoding scheme and endianness
- results of autodetection in getEncodingName() .
Also presence of Byte Order Mark should be specified explicitly.
Parameters: encoding - Name of the autodetected encoding scheme. Parameters: isBigEndian - Detected byte order of the data. true iforder is big-endian, false if little-endian,and null if byte order is not relevant forthis encoding scheme. Parameters: hasBOM - true if BOM is present,false otherwise. |
copyFrom | public void copyFrom(EncodingInfo encInfo)(Code) | | Copies property values from another EncodingInfo instance.
Strange enough, but sometimes such behavior is preferred to simple
assignment or cloning. More specifically, this method is currently used
(at least it was :) in XmlCharsetDetector.getCharsetAwareReader
(other two ways simply don't work).
Parameters: encInfo - source object which properties should be mirrored in thisinstance |
getEncoding | public String getEncoding()(Code) | | Returns current encoding scheme (or charset).
|
hasBOM | public boolean hasBOM()(Code) | | Accessor for fHasBOM . Imho mutator is not required.
|
isBigEndian | public Boolean isBigEndian()(Code) | | Accessor for fIsBigEndian . Should we define a mutator too?
|
setEncoding | public void setEncoding(String encoding)(Code) | | Sets new value of stored encoding (charset?) name.
|
toString | public String toString()(Code) | | Returns current state of this instance in human-readable form.
|
|
|