}
}
if(root.isMissingNode()){
throw new MissingNodeException(pp.treeFields());
}
Part last = pp.last();
if(last instanceof PartsLexer.ArrayField){
PartsLexer.ArrayField arr = (PartsLexer.ArrayField)last;
int index = arr.arrayIndex;
root = root.path(last.getName());
ArrayNode arrNode = (ArrayNode)root;
if(arrNode.size()<=index){
arrNode.add(data);
}else{
arrNode.set(index, data);
}
return root;
}else{
try{
((ObjectNode)root).put(last.getName(),data);
}catch(Exception e){
throw new MissingNodeException(pp.treeFields());
}
return root.get(last.getName());
}
}