Package org.hippoecm.repository.api
Class StringCodecFactory
java.lang.Object
org.hippoecm.repository.api.StringCodecFactory
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
Modifier and TypeClassDescriptionstatic final class
Usage of this class discouraged.static class
Usage of this class discouraged.static class
Helper class for encoding and decoding node namesstatic class
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
ConstructorDescriptionStringCodecFactory
(Map<String, StringCodec> codecs) Initialized a StringCodecFactory with the given and fixed StringCodec mappings. -
Method Summary
Modifier and TypeMethodDescriptionRequests the default encoder to use.getStringCodec
(String encoding) Requests which encoder to use for the given symbolic name.getStringCodec
(String encoding, String locale) Requests which encoder to use for the given symbolic name and locale.
-
Constructor Details
-
StringCodecFactory
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 Details
-
getStringCodec
Requests the default encoder to use.- Returns:
- returns the fall-back or default encoder to use, or null if non was defined.
-
getStringCodec
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
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.
-