Example usage for javax.xml.registry.infomodel LocalizedString getCharsetName

List of usage examples for javax.xml.registry.infomodel LocalizedString getCharsetName

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel LocalizedString getCharsetName.

Prototype

String getCharsetName() throws JAXRException;

Source Link

Document

Gets the canonical name for the charset for this object.

Usage

From source file:it.cnr.icar.eric.client.xml.registry.infomodel.InternationalStringImpl.java

protected boolean removeLocalizedString_internal(LocalizedString ls) throws JAXRException {
    String key = getKey(ls.getLocale(), ls.getCharsetName());
    LocalizedString old = localizedStringMap.get(key);

    if (ls == old) {
        localizedStringMap.remove(key);/*from  w  ww . ja  v a 2  s  .c  o  m*/
        return true;
    } else {
        return false;
    }
}

From source file:it.cnr.icar.eric.client.xml.registry.infomodel.InternationalStringImpl.java

protected void addLocalizedString_internal(LocalizedString ls) throws JAXRException {
    if (!localizedStringMap.containsValue(ls)) {
        localizedStringMap.put(getKey(ls.getLocale(), ls.getCharsetName()), ls);
    } else {// w  w  w .j av  a2s  . c om
        LocalizedString lsOrig = localizedStringMap.get(getKey(ls.getLocale(), ls.getCharsetName()));
        if (lsOrig == null) {
            Iterator<String> keys = localizedStringMap.keySet().iterator();
            LocalizedString tempLS = null;
            String tempKey = null;

            while (keys.hasNext() && tempKey == null) {
                tempKey = keys.next();
                tempLS = localizedStringMap.get(tempKey);
                if (tempLS != ls) {
                    tempKey = null;
                }
            }
            if (tempKey != null) {
                localizedStringMap.remove(tempKey);
                localizedStringMap.put(getKey(ls.getLocale(), ls.getCharsetName()), ls);
            }
        }
    }
}