* @param in The input where the data is read from
* @throws Exception When the input stream is not readable or corrupt
*/
public synchronized void readInitDataFrom(PushbackInputStream in)
throws Exception {
TextToken token = TextToken.nextToken(in);
removeChildren();
if (!token.isChar(OPENB)) {
throw new Exception("DataModelContainer is not initialized with:'" + OPENB + "' have:" + token);
}
while (true) {
token = TextToken.nextToken(in);
if (token.isIdentifier(TYPE)) {
token = TextToken.nextToken(in);
String type = token.getString();
token = TextToken.nextToken(in);
String name = token.getString();
DataModel m = createMember(type, name);
if (m instanceof DataModelContainer) {
((DataModelContainer) m).readInitDataFrom(in);
} else {
m.readDataFrom(in);
}
append(m);
} else if (token.isChar(CLOSEB)) {
break;
} else {
throw new Exception("Expecting " + TYPE + " or " + CLOSEB + " but have:" + token);
}
}