Output outContext = response.createOutput("context-" + (contextNum++));
outContexts.add(outContext);
outContext.setContent(contextEntry.getKey());
ComparableContext context = contextEntry.getValue();
int entryNum = 0;
while (context != null)
{
for (Map.Entry<Object, Object> dataEntry : context.getData().entrySet())
{
Output outEntry = response.createOutput("entry-" + (entryNum++));
outContext.add(outEntry);
outEntry.setContent(dataEntry.getKey() + ":" + dataEntry.getValue());
if (dataEntry.getValue() instanceof DefaultUserEnvironment)
{
int attrNum = 0;
for (Map.Entry<String, Object> attrEntry : ((DefaultUserEnvironment) dataEntry.getValue())
.getAttributes().entrySet())
{
Output outAttr = response.createOutput("attr-" + (attrNum++));
outEntry.add(outAttr);
outAttr.setContent(attrEntry.getKey() + "=" + attrEntry.getValue());
}
}
}
context = context.getParentContext();
}
}
}