public void startElement(String tag, java.util.HashMap h) { if (tag.equals("hyphen-char")) { String hh = (String) h.get("value"); if (hh != null && hh.length() == 1) { hyphenChar = hh.charAt(0); } } else if (tag.equals("classes")) { currElement = ELEM_CLASSES; } else if (tag.equals("patterns")) { currElement = ELEM_PATTERNS; } else if (tag.equals("exceptions")) { currElement = ELEM_EXCEPTIONS; exception = new ArrayList(); } else if (tag.equals("hyphen")) { if (token.length() > 0) { exception.add(token.toString()); } exception.add(new Hyphen((String) h.get(HtmlTags.PRE), (String) h .get("no"), (String) h.get("post"))); currElement = ELEM_HYPHEN; } token.setLength(0); }
public void startElement(String tag, java.util.HashMap h) { if (tag.equals("hyphen-char")) { String hh = (String) h.get("value"); if (hh != null && hh.length() == 1) { hyphenChar = hh.charAt(0); } } else if (tag.equals("classes")) { currElement = ELEM_CLASSES; } else if (tag.equals("patterns")) { currElement = ELEM_PATTERNS; } else if (tag.equals("exceptions")) { currElement = ELEM_EXCEPTIONS; exception = new ArrayList(); } else if (tag.equals("hyphen")) { if (token.length() > 0) { exception.add(token.toString()); } exception.add(new Hyphen((String) h.get("pre"), (String) h.get("no"), (String) h.get("post"))); currElement = ELEM_HYPHEN; } token.setLength(0); }
public void startElement(String tag, java.util.HashMap h) { if (tag.equals("hyphen-char")) { String hh = (String) h.get("value"); if (hh != null && hh.length() == 1) { hyphenChar = hh.charAt(0); } } else if (tag.equals("classes")) { currElement = ELEM_CLASSES; } else if (tag.equals("patterns")) { currElement = ELEM_PATTERNS; } else if (tag.equals("exceptions")) { currElement = ELEM_EXCEPTIONS; exception = new ArrayList(); } else if (tag.equals("hyphen")) { if (token.length() > 0) { exception.add(token.toString()); } exception.add(new Hyphen((String) h.get(HtmlTags.PRE), (String) h .get("no"), (String) h.get("post"))); currElement = ELEM_HYPHEN; } token.setLength(0); }
protected ArrayList normalizeException(ArrayList ex) { ArrayList res = new ArrayList(); for (int i = 0; i < ex.size(); i++) { Object item = ex.get(i); if (item instanceof String) { String str = (String) item; StringBuffer buf = new StringBuffer(); for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); if (c != hyphenChar) { buf.append(c); } else { res.add(buf.toString()); buf.setLength(0); char[] h = new char[1]; h[0] = hyphenChar; // we use here hyphenChar which is not necessarily // the one to be printed res.add(new Hyphen(new String(h), null, null)); } } if (buf.length() > 0) { res.add(buf.toString()); } } else { res.add(item); } } return res; }
protected ArrayList normalizeException(ArrayList ex) { ArrayList res = new ArrayList(); for (int i = 0; i < ex.size(); i++) { Object item = ex.get(i); if (item instanceof String) { String str = (String) item; StringBuffer buf = new StringBuffer(); for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); if (c != hyphenChar) { buf.append(c); } else { res.add(buf.toString()); buf.setLength(0); char[] h = new char[1]; h[0] = hyphenChar; // we use here hyphenChar which is not necessarily // the one to be printed res.add(new Hyphen(new String(h), null, null)); } } if (buf.length() > 0) { res.add(buf.toString()); } } else { res.add(item); } } return res; }
protected ArrayList normalizeException(ArrayList ex) { ArrayList res = new ArrayList(); for (int i = 0; i < ex.size(); i++) { Object item = ex.get(i); if (item instanceof String) { String str = (String) item; StringBuffer buf = new StringBuffer(); for (int j = 0; j < str.length(); j++) { char c = str.charAt(j); if (c != hyphenChar) { buf.append(c); } else { res.add(buf.toString()); buf.setLength(0); char[] h = new char[1]; h[0] = hyphenChar; // we use here hyphenChar which is not necessarily // the one to be printed res.add(new Hyphen(new String(h), null, null)); } } if (buf.length() > 0) { res.add(buf.toString()); } } else { res.add(item); } } return res; }