use of org.directwebremoting.extend.OutboundVariable in project ma-core-public by infiniteautomation.
the class ObjectOutboundVariable method getInlineDefinition.
/* (non-Javadoc)
* @see org.directwebremoting.dwrp.AbstractOutboundVariable#getInlineDefinition()
*/
protected String getInlineDefinition() {
StringBuffer buffer = new StringBuffer();
buffer.append('{');
boolean first = true;
for (Iterator it = ovs.entrySet().iterator(); it.hasNext(); ) {
Map.Entry entry = (Map.Entry) it.next();
String name = (String) entry.getKey();
OutboundVariable nested = (OutboundVariable) entry.getValue();
String innerAssignCode = nested.getAssignCode();
if (!first) {
buffer.append(',');
}
// and when we are not recursive
if (LocalUtil.isSimpleName(name)) {
buffer.append(name);
buffer.append(':');
buffer.append(innerAssignCode);
} else {
buffer.append('\'');
buffer.append(name);
buffer.append("\':");
buffer.append(innerAssignCode);
}
// we don't need to do this one the hard way
first = false;
}
buffer.append('}');
return buffer.toString();
}
Aggregations