protected static final Log _logger = LogFactory.getLog(CdeRunJsModelWriter.class);
public void write(java.lang.Object output, IThingWriteContext context, Thing t)
throws ThingWriteException
{
MetaModel model = (MetaModel)t;
StringBuilder out = (StringBuilder)output;
IThingWriterFactory factory = context.getFactory();
assert factory != null;
// GLOBAL PROPERTIES
for(PropertyType prop : model.getPropertyTypes())
{
IThingWriter propWriter;
try
{
propWriter = factory.getWriter(prop);
assert propWriter != null;
}
catch(UnsupportedThingException ex)
{
ThingWriteException ex2 = new ThingWriteException(ex);
if(context.getBreakOnError()) { throw ex2; }
_logger.error(ex2);
continue;
}
propWriter.write(out, context, prop);
}
// COMPONENTS
// Components output their own properties
for(ComponentType comp : model.getComponentTypes())
{
IThingWriter compWriter;
try
{
compWriter = factory.getWriter(comp);