Methods Summary |
---|
protected static HeaderList | getList(Header sipHeader)Returns a list object for this header if it has an associated
list object.
try {
Class headerClass = sipHeader.getClass();
Class listClass = (Class) headerListTable.get(headerClass);
HeaderList shl = (HeaderList) listClass.newInstance();
shl.setHeaderName(sipHeader.getHeaderName());
return shl;
} catch (InstantiationException ex) {
ex.printStackTrace();
} catch (IllegalAccessException ex) {
ex.printStackTrace();
}
return null;
|
protected static java.lang.Class | getListClass(java.lang.Class sipHdrClass)Gets the associated list class.
return (Class) headerListTable.get(sipHdrClass);
|
protected static boolean | hasList(Header sipHeader)Returns true if this has an associated list object.
if (sipHeader instanceof HeaderList)
return false;
else {
Class headerClass = sipHeader.getClass();
return headerListTable.get(headerClass) != null;
}
|
protected static boolean | hasList(java.lang.Class sipHdrClass)Returns true if this has an associated list object.
return headerListTable.get(sipHdrClass) != null;
|
private static void | initializeListMap()Builds a table mapping between objects that have a list form
and the class of such objects.
initializeListMap();
headerListTable = new Hashtable();
headerListTable.put(ExtensionHeader.clazz,
new HeaderList().getClass());
headerListTable.put(ParameterLessHeader.clazz,
new HeaderList().getClass());
headerListTable.put(ContactHeader.clazz,
new ContactList().getClass());
headerListTable.put(ViaHeader.clazz,
new ViaList().getClass());
headerListTable.put(WWWAuthenticateHeader.clazz,
new WWWAuthenticateList().getClass());
headerListTable.put(RouteHeader.clazz,
new RouteList().getClass());
headerListTable.put(ProxyAuthenticateHeader.clazz,
new ProxyAuthenticateList().getClass());
headerListTable.put(ProxyAuthorizationHeader.clazz,
new HeaderList().getClass());
headerListTable.put(RecordRouteHeader.clazz,
new RecordRouteList().getClass());
|