String method = doc.elementText("method"); if (!"zlib".equals(method)) { error = "<failure xmlns='http://jabber.org/protocol/compress'><unsupported-method/></failure>";
String method = doc.elementText("method"); if (!"zlib".equals(method)) { error = "<failure xmlns='http://jabber.org/protocol/compress'><unsupported-method/></failure>";
username = iqElement.elementText("username"); password = iqElement.elementText("password"); email = iqElement.elementText("email"); name = iqElement.elementText("name");
private static String getError(Element testCase) { String msg = testCase.elementText("error"); if(msg!=null) return msg; return testCase.elementText("failure"); }
/** * Returns a text description of the error, or <tt>null</tt> if there * is no text description. * * @return the text description of the error. */ public String getText() { return element.elementText("text"); }
private static String getError(Element testCase) { String msg = testCase.elementText("error"); if (msg != null) { return msg; } return testCase.elementText("failure"); }
/** * Gets the current person assigned to the issue. * * <p> * This can be an user name or an alias name, like "issues@hudson". * It's not clear exactly what's allowed and what's not. */ public String getAssignedTo() { return rawData.elementText("assigned_to"); }
private String parseOptionalString(Element element, String key, String defaultValue) { final Element optional = element.element(key); return (optional != null) ? element.elementText(key) : defaultValue; } }
/** * Gets the number of votes on this issue. */ public int getVotes() { try { return Integer.parseInt(rawData.elementText("votes")); } catch (NumberFormatException e) { return 0; } }
@Override public boolean matches(Object arg0) { Element e = (Element) arg0; if ((e.element("note") == null) || (e.element("note").attributeValue("type") == null) || !e.element("note").attributeValue("type").equals("error")) { return false; } String errTxt = e.elementText("note"); return this.message.equals(errTxt); }
@Override public boolean matches(Object arg0) { Element e = (Element) arg0; if ((e.element("note") == null) || (e.element("note").attributeValue("type") == null) || !e.element("note").attributeValue("type").equals("error")) { return false; } String errTxt = e.elementText("note"); return errTxt.contains(this.message) && ((this.value == null) || errTxt.contains(this.value)); }
static JndiDatasource parse(Element datasourceElement) { String jndiName = datasourceElement.elementText(JNDI_NAME); return new JndiDatasource(jndiName); }
@Override public DatabaseConfig parse(Element element) { String name = element.elementText(NAME); String delegator = parseOptionalString(element, DELEGATOR_NAME, name); String databaseType = element.elementText(DATABASE_TYPE); String schemaName = element.elementText(SCHEMA_NAME); Datasource datasource = parseDatasource(element); return new DatabaseConfig(name, delegator, databaseType, schemaName, datasource); }
/** * Gets the resolution of this issue. */ public IssueResolution getResolution() { String s = rawData.elementText("resolution"); if(s.length()==0) return null; return IssueResolution.valueOf(s); }
/** * Gets the last modified date of this issue. */ public Calendar getLastModified() { return formatDate(lastModifiedFormat,rawData.elementText("delta_ts")); }
/** * Gets the version to which this issue belongs to. */ public IssueVersion getVersion() { return new IssueVersion(rawData.elementText("version")); }
/** * Gets the type of the issue. */ public IssueType getType() { return IssueType.valueOf(rawData.elementText("issue_type")); }
private static InMsg parseInLocationMsg(Element root, String toUserName, String fromUserName, Integer createTime, String msgType) { InLocationMsg msg = new InLocationMsg(toUserName, fromUserName, createTime, msgType); msg.setLocation_X(root.elementText("Location_X")); msg.setLocation_Y(root.elementText("Location_Y")); msg.setScale(root.elementText("Scale")); msg.setLabel(root.elementText("Label")); msg.setMsgId(root.elementText("MsgId")); return msg; }
private static InMsg parseInLinkMsg(Element root, String toUserName, String fromUserName, Integer createTime, String msgType) { InLinkMsg msg = new InLinkMsg(toUserName, fromUserName, createTime, msgType); msg.setTitle(root.elementText("Title")); msg.setDescription(root.elementText("Description")); msg.setUrl(root.elementText("Url")); msg.setMsgId(root.elementText("MsgId")); return msg; }
private static InMsg parseInVideoMsg(Element root, String toUserName, String fromUserName, Integer createTime, String msgType) { InVideoMsg msg = new InVideoMsg(toUserName, fromUserName, createTime, msgType); msg.setMediaId(root.elementText("MediaId")); msg.setThumbMediaId(root.elementText("ThumbMediaId")); msg.setMsgId(root.elementText("MsgId")); return msg; }