93949596979899100
String expr = ContactsXML.X_CONTACTS_CONTACT+"[@"+ContactsXML.ATTR_EMAIL+"='"+email+"']"; try { return this.xSearchElement(expr); } catch (XPathExpressionException ex) { throw new ContactException("Internal error", ex); } }
113114115116117118119120
*/ public String getEmailByName(String name) throws ContactException { Element e = this.getElementByName(name); if (e == null) throw new ContactException("Unknown contact: "+name); return e.getAttribute(ContactsXML.ATTR_EMAIL); }
128129130131132133134135
*/ public int getMaxSize(String name) throws ContactException { Element e = this.getElementByName(name); if (e == null) throw new ContactException("Unknown contact: "+name); return Integer.parseInt(e.getAttribute(ContactsXML.ATTR_MAXSIZE)); }
143144145146147148149150
*/ public String getNameByEmail(String email) throws ContactException { Element e = this.getElementByEmail(email); if (e == null) throw new ContactException("Cannot find contact for email '"+email+"' on "+this.getDataFileName()); return e.getAttribute(ContactsXML.ATTR_NAME); }