public static IntEntity create(String id, String repl) { return create(id, repl.toCharArray()); }
/** * Returns an entity (possibly from cache) for the argument character using the encoded * representation in mInputBuffer[entityStartPos ... mInputPtr-1]. */ protected EntityDecl getIntEntity(int ch, final char[] originalChars) { String cacheKey = new String(originalChars); IntEntity entity = (IntEntity) mCachedEntities.get(cacheKey); if (entity == null) { String repl; if (ch <= 0xFFFF) { repl = Character.toString((char) ch); } else { StringBuffer sb = new StringBuffer(2); ch -= 0x10000; sb.append((char) ((ch >> 10) + 0xD800)); sb.append((char) ((ch & 0x3FF) + 0xDC00)); repl = sb.toString(); } entity = IntEntity.create(new String(originalChars), repl); mCachedEntities.put(cacheKey, entity); } return entity; }
public void setCustomInternalEntities(Map m) { Map entMap; if (m == null || m.size() < 1) { entMap = Collections.EMPTY_MAP; } else { int len = m.size(); entMap = new HashMap(len + (len >> 1), 0.75f); Iterator it = m.entrySet().iterator(); while (it.hasNext()) { Map.Entry me = (Map.Entry) it.next(); Object val = me.getValue(); char[] ch; if (val == null) { ch = DataUtil.getEmptyCharArray(); } else if (val instanceof char[]) { ch = (char[]) val; } else { // Probably String, but let's just ensure that String str = val.toString(); ch = str.toCharArray(); } String name = (String) me.getKey(); entMap.put(name, IntEntity.create(name, ch)); } } _setSpecialProperty(SP_IX_CUSTOM_ENTITIES, entMap); }
public static IntEntity create(String id, String repl) { return create(id, repl.toCharArray()); }
public static IntEntity create(String id, String repl) { return create(id, repl.toCharArray()); }
public static IntEntity create(String id, String repl) { return create(id, repl.toCharArray()); }
public static IntEntity create(String id, String repl) { return create(id, repl.toCharArray()); }
public static IntEntity create(String id, String repl) { return create(id, repl.toCharArray()); }
public static IntEntity create(String id, String repl) { return create(id, repl.toCharArray()); }
public static IntEntity create(String id, String repl) { return create(id, repl.toCharArray()); }
/** * Returns an entity (possibly from cache) for the argument character using the encoded * representation in mInputBuffer[entityStartPos ... mInputPtr-1]. */ protected EntityDecl getIntEntity(int ch, final char[] originalChars) { String cacheKey = new String(originalChars); IntEntity entity = mCachedEntities.get(cacheKey); if (entity == null) { String repl; if (ch <= 0xFFFF) { repl = Character.toString((char) ch); } else { StringBuffer sb = new StringBuffer(2); ch -= 0x10000; sb.append((char) ((ch >> 10) + 0xD800)); sb.append((char) ((ch & 0x3FF) + 0xDC00)); repl = sb.toString(); } entity = IntEntity.create(new String(originalChars), repl); mCachedEntities.put(cacheKey, entity); } return entity; }
/** * Returns an entity (possibly from cache) for the argument character using the encoded * representation in mInputBuffer[entityStartPos ... mInputPtr-1]. */ protected EntityDecl getIntEntity(int ch, final char[] originalChars) { String cacheKey = new String(originalChars); IntEntity entity = mCachedEntities.get(cacheKey); if (entity == null) { String repl; if (ch <= 0xFFFF) { repl = Character.toString((char) ch); } else { StringBuffer sb = new StringBuffer(2); ch -= 0x10000; sb.append((char) ((ch >> 10) + 0xD800)); sb.append((char) ((ch & 0x3FF) + 0xDC00)); repl = sb.toString(); } entity = IntEntity.create(new String(originalChars), repl); mCachedEntities.put(cacheKey, entity); } return entity; }
/** * Returns an entity (possibly from cache) for the argument character using the encoded * representation in mInputBuffer[entityStartPos ... mInputPtr-1]. */ protected EntityDecl getIntEntity(int ch, final char[] originalChars) { String cacheKey = new String(originalChars); IntEntity entity = mCachedEntities.get(cacheKey); if (entity == null) { String repl; if (ch <= 0xFFFF) { repl = Character.toString((char) ch); } else { StringBuffer sb = new StringBuffer(2); ch -= 0x10000; sb.append((char) ((ch >> 10) + 0xD800)); sb.append((char) ((ch & 0x3FF) + 0xDC00)); repl = sb.toString(); } entity = IntEntity.create(new String(originalChars), repl); mCachedEntities.put(cacheKey, entity); } return entity; }
/** * Returns an entity (possibly from cache) for the argument character using the encoded * representation in mInputBuffer[entityStartPos ... mInputPtr-1]. */ protected EntityDecl getIntEntity(int ch, final char[] originalChars) { String cacheKey = new String(originalChars); IntEntity entity = (IntEntity) mCachedEntities.get(cacheKey); if (entity == null) { String repl; if (ch <= 0xFFFF) { repl = Character.toString((char) ch); } else { StringBuffer sb = new StringBuffer(2); ch -= 0x10000; sb.append((char) ((ch >> 10) + 0xD800)); sb.append((char) ((ch & 0x3FF) + 0xDC00)); repl = sb.toString(); } entity = IntEntity.create(new String(originalChars), repl); mCachedEntities.put(cacheKey, entity); } return entity; }
/** * Returns an entity (possibly from cache) for the argument character using the encoded * representation in mInputBuffer[entityStartPos ... mInputPtr-1]. */ protected EntityDecl getIntEntity(int ch, final char[] originalChars) { String cacheKey = new String(originalChars); IntEntity entity = mCachedEntities.get(cacheKey); if (entity == null) { String repl; if (ch <= 0xFFFF) { repl = Character.toString((char) ch); } else { StringBuffer sb = new StringBuffer(2); ch -= 0x10000; sb.append((char) ((ch >> 10) + 0xD800)); sb.append((char) ((ch & 0x3FF) + 0xDC00)); repl = sb.toString(); } entity = IntEntity.create(new String(originalChars), repl); mCachedEntities.put(cacheKey, entity); } return entity; }
public void setCustomInternalEntities(Map<String,?> m) { Map<String,EntityDecl> entMap; if (m == null || m.size() < 1) { entMap = Collections.emptyMap(); } else { int len = m.size(); entMap = new HashMap<String,EntityDecl>(len + (len >> 1), 0.75f); for (Map.Entry<String,?> me : m.entrySet()) { Object val = me.getValue(); char[] ch; if (val == null) { ch = DataUtil.getEmptyCharArray(); } else if (val instanceof char[]) { ch = (char[]) val; } else { // Probably String, but let's just ensure that String str = val.toString(); ch = str.toCharArray(); } String name = me.getKey(); entMap.put(name, IntEntity.create(name, ch)); } } _setSpecialProperty(SP_IX_CUSTOM_ENTITIES, entMap); }
public void setCustomInternalEntities(Map<String,?> m) { Map<String,EntityDecl> entMap; if (m == null || m.size() < 1) { entMap = Collections.emptyMap(); } else { int len = m.size(); entMap = new HashMap<String,EntityDecl>(len + (len >> 1), 0.75f); for (Map.Entry<String,?> me : m.entrySet()) { Object val = me.getValue(); char[] ch; if (val == null) { ch = DataUtil.getEmptyCharArray(); } else if (val instanceof char[]) { ch = (char[]) val; } else { // Probably String, but let's just ensure that String str = val.toString(); ch = str.toCharArray(); } String name = me.getKey(); entMap.put(name, IntEntity.create(name, ch)); } } _setSpecialProperty(SP_IX_CUSTOM_ENTITIES, entMap); }
public void setCustomInternalEntities(Map<String,?> m) { Map<String,EntityDecl> entMap; if (m == null || m.size() < 1) { entMap = Collections.emptyMap(); } else { int len = m.size(); entMap = new HashMap<String,EntityDecl>(len + (len >> 1), 0.75f); for (Map.Entry<String,?> me : m.entrySet()) { Object val = me.getValue(); char[] ch; if (val == null) { ch = DataUtil.getEmptyCharArray(); } else if (val instanceof char[]) { ch = (char[]) val; } else { // Probably String, but let's just ensure that String str = val.toString(); ch = str.toCharArray(); } String name = me.getKey(); entMap.put(name, IntEntity.create(name, ch)); } } _setSpecialProperty(SP_IX_CUSTOM_ENTITIES, entMap); }
public void setCustomInternalEntities(Map m) { Map entMap; if (m == null || m.size() < 1) { entMap = Collections.EMPTY_MAP; } else { int len = m.size(); entMap = new HashMap(len + (len >> 1), 0.75f); Iterator it = m.entrySet().iterator(); while (it.hasNext()) { Map.Entry me = (Map.Entry) it.next(); Object val = me.getValue(); char[] ch; if (val == null) { ch = DataUtil.getEmptyCharArray(); } else if (val instanceof char[]) { ch = (char[]) val; } else { // Probably String, but let's just ensure that String str = val.toString(); ch = str.toCharArray(); } String name = (String) me.getKey(); entMap.put(name, IntEntity.create(name, ch)); } } _setSpecialProperty(SP_IX_CUSTOM_ENTITIES, entMap); }
public void setCustomInternalEntities(Map m) { Map entMap; if (m == null || m.size() < 1) { entMap = JdkFeatures.getInstance().getEmptyMap(); } else { int len = m.size(); entMap = new HashMap(len + (len >> 1), 0.75f); Iterator it = m.entrySet().iterator(); while (it.hasNext()) { Map.Entry me = (Map.Entry) it.next(); Object val = me.getValue(); char[] ch; if (val == null) { ch = EmptyIterator.getEmptyCharArray(); } else if (val instanceof char[]) { ch = (char[]) val; } else { // Probably String, but let's just ensure that String str = val.toString(); ch = str.toCharArray(); } String name = (String) me.getKey(); entMap.put(name, IntEntity.create(name, ch)); } } setSpecialProperty(SP_IX_CUSTOM_ENTITIES, entMap); }