/** Get the header value (i.e. what follows the name:). * This merely goes through and lops off the portion that follows * the headerName: */ public String getHeaderValue() { return encodeBody(new StringBuilder()).toString(); }
public StringBuilder encode(StringBuilder buffer) { buffer.append(this.headerName).append(COLON).append(SP); this.encodeBody(buffer); buffer.append(NEWLINE); return buffer; }
protected StringBuilder encodeBody(StringBuilder buffer) { ListIterator<HDR> iterator = this.listIterator(); while (true) { SIPHeader sipHeader = (SIPHeader) iterator.next(); if ( sipHeader == this ) throw new RuntimeException ("Unexpected circularity in SipHeaderList"); sipHeader.encodeBody(buffer); // if (body.equals("")) System.out.println("BODY == "); if (iterator.hasNext()) { if (!this.headerName.equals(PrivacyHeader.NAME)) buffer.append(Separators.COMMA); else buffer.append(Separators.SEMICOLON); continue; } else break; } return buffer; }