/** * Retorna o campo da posição indicada. Se o campo ainda não existir, cria-o. */ public SInstance getField(int fieldIndex) { SInstance instance = (fields == null) ? null : fields.getByIndex(fieldIndex); return instance != null ? instance : createField(fieldIndex); }
/** * Retorna o campo da posição indicada. Se o campo ainda não existir, cria-o. */ public SInstance getField(int fieldIndex) { SInstance instance = (fields == null) ? null : fields.getByIndex(fieldIndex); return instance != null ? instance : createField(fieldIndex); }
@Override void setValue(PathReader pathReader, Object value) { int fieldIndex = findFieldIndex(pathReader); SInstance instancia = (fields == null) ? null : fields.getByIndex(fieldIndex); if (instancia == null) { if (value == null) { return; } instancia = createField(fieldIndex); } if (pathReader.isLast()) { if (value == null) { SInstance child = fields.getByIndex(fieldIndex); if (child != null) { child.internalOnRemove(); fields.remove(fieldIndex); } } else { instancia.setValue(value); } } else { instancia.setValue(pathReader.next(), value); } }
@Override void setValue(PathReader pathReader, Object value) { int fieldIndex = findFieldIndex(pathReader); SInstance instance = (fields == null) ? null : fields.getByIndex(fieldIndex); if (instance == null) { if (value == null) { return; } instance = createField(fieldIndex); } if (pathReader.isLast()) { if (value == null) { SInstance child = fields.getByIndex(fieldIndex); if (child != null) { child.internalOnRemove(); fields.remove(fieldIndex); } } else { instance.setValue(value); } } else { instance.setValue(pathReader.next(), value); } }