class ConfigurationBasedNamespaceManager extends AbstractNamespaceManager {

    @Override
    public String getPrefix(String namespace) {
        if (namespace == null) {
            namespace = "";
        }

        // configuration stores the permanent mapping
        // this has precedence
        String prefix = configuration.getString(namespace);
        if (prefix == null || prefix.isEmpty()) {
            // in case no permanent mapping is found - or the prefix is invalid, check the in-memory ones
            prefix = this.namespaceToPrefixMap.get(namespace);
            if (prefix == null) {
                prefix = this.generatePrefix(namespace);
                this.namespaceToPrefixMap.put(namespace, prefix);
            }
        }
        return prefix;
    }

    public  ConfigurationBasedNamespaceManager(Configuration configuration);

}