/** return true if this has an associated list object. */ protected static boolean hasList(SIPHeader sipHeader) { if (sipHeader instanceof SIPHeaderList) return false; else { Class headerClass = sipHeader.getClass(); return headerListTable.get(headerClass) != null; } }
/** Return a list object for this header if it has an associated list object. */ protected static SIPHeaderList getList(SIPHeader sipHeader) { if (!initialized) initializeListMap(); try { Class headerClass = sipHeader.getClass(); Class listClass = (Class) headerListTable.get(headerClass); return (SIPHeaderList) listClass.newInstance(); } catch (InstantiationException ex) { InternalError.handleException(ex); } catch (IllegalAccessException ex) { InternalError.handleException(ex); } return null; }