return write(obj, ctx);
}
private static void write(GEObject obj, Class clazz, Context ctx) {
ClassDescriptor cd = Util.getDescriptor(clazz);
ctx.p.print('<');
ctx.p.print(cd.getCullName());
ctx.p.print('>');
if (obj == null) {
ctx.p.print(NONE);
} else {
ctx.p.println();
ctx.p.indent();
for(int i = 0; i < cd.getPropertyCount(); i++) {
PropertyDescriptor pd = cd.getProperty(i);
if (!ctx.include(pd)) {
continue;
}
if (pd instanceof SimplePropertyDescriptor) {
write(obj, (SimplePropertyDescriptor)pd, ctx);
} else if (pd instanceof ListPropertyDescriptor) {
write(obj, (ListPropertyDescriptor)pd, ctx);
} else if (pd instanceof MapPropertyDescriptor) {
write(obj, (MapPropertyDescriptor)pd, ctx);
} else if (pd instanceof MapListPropertyDescriptor) {
write(obj, (MapListPropertyDescriptor)pd, ctx);
} else {
throw new IllegalStateException("Unknown property type " + pd.getClass());
}
}
ctx.p.deindent();
}
ctx.p.print("</");
ctx.p.print(cd.getCullName());
ctx.p.println('>');
}