}
}
}
boolean isCollection = false;
TraversableSource traversablesource = null;
if (source instanceof TraversableSource) {
traversablesource = (TraversableSource) source;
isCollection = traversablesource.isSourceCollection();
attributes.addAttribute("", COLLECTION_ATTR_NAME,
COLLECTION_ATTR_NAME, "CDATA",
String.valueOf(isCollection));
String parent = traversablesource.getParentSource();
if ((parent!=null) && (parent.length()>0)) {
attributes.addAttribute("", PARENT_ATTR_NAME,
PARENT_ATTR_NAME, "CDATA",
parent);
}
}
this.contentHandler.startElement(SOURCE_NS, SOURCE_NODE_NAME,
SOURCE_NODE_QNAME, attributes);
if (this.properties && (source instanceof InspectableSource)) {
pushLiveSourceProperties((InspectableSource) source);
}
if (this.properties) {
pushComputedSourceProperties(source);
}
if (this.permissions) {
try {
if (source instanceof RestrictableSource) {
pushSourcePermissions((RestrictableSource) source);
}
} catch (SourceException se) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Could not retrieve source permissions",
se);
}
}
}
if (this.locks && (source instanceof LockableSource)) {
pushSourceLocks((LockableSource) source);
}
if ((isCollection) && (deep>0)) {
this.contentHandler.startElement(SOURCE_NS,
CHILDREN_NODE_NAME,
CHILDREN_NODE_QNAME,
new AttributesImpl());
for (int i = 0; i<traversablesource.getChildSourceCount();
i++) {
try {
pushSourceDescription(traversablesource.getChildSource(i),
deep-1);
} catch (SourceException se) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Could not retrieve source",
se);