public static java.util.List | inspectViewable(java.lang.Object viewable, boolean drilldown, int indentLevel, java.lang.String indentString)Inspect an object that may be viewable, and drill down if told
to
List objects = new ArrayList();
if (viewable instanceof POIFSViewable)
{
POIFSViewable inspected = ( POIFSViewable ) viewable;
objects.add(indent(indentLevel, indentString,
inspected.getShortDescription()));
if (drilldown)
{
if (inspected.preferArray())
{
Object[] data = inspected.getViewableArray();
for (int j = 0; j < data.length; j++)
{
objects.addAll(inspectViewable(data[ j ], drilldown,
indentLevel + 1,
indentString));
}
}
else
{
Iterator iter = inspected.getViewableIterator();
while (iter.hasNext())
{
objects.addAll(inspectViewable(iter.next(),
drilldown,
indentLevel + 1,
indentString));
}
}
}
}
else
{
objects.add(indent(indentLevel, indentString,
viewable.toString()));
}
return objects;
|