private synchronized void init() {
if (properties == null) {
String json = kernel.getNodes(
path, revision, 0, 0, MAX_CHILD_NODE_NAMES, null);
JsopReader reader = new JsopTokenizer(json);
reader.read('{');
properties = new LinkedHashMap<String, PropertyState>();
childNodes = new LinkedHashMap<String, NodeState>();
do {
String name = reader.readString();
reader.read(':');
if (":childNodeCount".equals(name)) {
childNodeCount =
Long.valueOf(reader.read(JsopTokenizer.NUMBER));
} else if (reader.matches('{')) {
reader.read('}');
String childPath = path + '/' + name;
if ("/".equals(path)) {
childPath = '/' + name;
}
childNodes.put(name, new KernelNodeState(kernel, valueFactory, childPath, revision));
} else if (reader.matches('[')) {
properties.put(name, new PropertyStateImpl(name, CoreValueMapper.listFromJsopReader(reader, valueFactory)));
} else {
CoreValue cv = CoreValueMapper.fromJsopReader(reader, valueFactory);
properties.put(name, new PropertyStateImpl(name, cv));
}
} while (reader.matches(','));
reader.read('}');
reader.read(JsopTokenizer.END);
}
}