Package org.hippoecm.repository.api
Class StringCodecFactory
- java.lang.Object
-
- org.hippoecm.repository.api.StringCodecFactory
-
public class StringCodecFactory extends Object
The StringCodecFactory allows you access to symbolic named StringCodec's. Typically a single instance of the StringCodecFactory is stored in the application framework.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StringCodecFactory.IdentEncoding
Usage of this class discouraged.static class
StringCodecFactory.ISO9075Helper
Usage of this class discouraged.static class
StringCodecFactory.NameEncoding
Helper class for encoding and decoding node namesstatic class
StringCodecFactory.UriEncoding
The UriEncoding class is responsible for creating human-readable URI from a String, by either removing characters or by mapping them to characters that need not be percent-encoded.
-
Constructor Summary
Constructors Constructor Description StringCodecFactory(Map<String,StringCodec> codecs)
Initialized a StringCodecFactory with the given and fixed StringCodec mappings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringCodec
getStringCodec()
Requests the default encoder to use.StringCodec
getStringCodec(String encoding)
Requests which encoder to use for the given symbolic name.StringCodec
getStringCodec(String encoding, String locale)
Requests which encoder to use for the given symbolic name and locale.
-
-
-
Constructor Detail
-
StringCodecFactory
public StringCodecFactory(Map<String,StringCodec> codecs)
Initialized a StringCodecFactory with the given and fixed StringCodec mappings.- Parameters:
codecs
- a map of codecs to bind to their symbolic names. The map becomes immutable.
-
-
Method Detail
-
getStringCodec
public StringCodec getStringCodec()
Requests the default encoder to use.- Returns:
- returns the fall-back or default encoder to use, or null if non was defined.
-
getStringCodec
public StringCodec getStringCodec(String encoding)
Requests which encoder to use for the given symbolic name.- Parameters:
encoding
- the symbolic name of the encoder that is requested- Returns:
- the
StringCodec
to use, which might be a fall-back encoder or null if non was defined.
-
getStringCodec
public StringCodec getStringCodec(String encoding, String locale)
Requests which encoder to use for the given symbolic name and locale. If a locale is defined aslanguage_country
, e.g.en_GB
, it will first trylanguage_country
and thenlanguage
.- Parameters:
encoding
- the symbolic name of the encoder that is requestedlocale
- the locale for the requested codec- Returns:
- the
StringCodec
to use, which might be a fall-back encoder or null if non was defined.
-
-