class XcodeBuilder extends Builder implements Script {

    public Element getElementFromLine(String line) {
        if (hitBuildFailedMessage) {
            return messageAtLevel(line, "error");
        }
        
        Element e = messageAtLevelIfContains(line, "warn", " warning: ");
        if (e != null) {
            return e;
        }
        
        e = messageAtLevelIfContains(line, "error", " error: ");
        if (e != null) {
            return e;
        }
        
        e = messageAtLevelIfContains(line, "error", "** BUILD FAILED **");
        if (e != null) {
            hitBuildFailedMessage = true;
            return e;
        }

        return null;
    }

}