@Override final SInstance getFieldLocal(PathReader pathReader) { SInstance instance = getChecking(pathReader); if (instance == null) { SFormUtil.resolveFieldType(getType(), pathReader); } return instance; }
@Override final SInstance getFieldLocal(PathReader pathReader) { SInstance instance = getChecking(pathReader); if (instance == null) { SFormUtil.resolveFieldType(getType(), pathReader); } return instance; }
final <T> T getValue(@Nonnull PathReader pathReader, @Nullable Class<T> resultClass) { SInstance instance = this; PathReader currentPath = pathReader; while (true) { if (currentPath.isEmpty()) { return instance.getValue(resultClass); } SInstance children = instance.getFieldLocalWithoutCreating(currentPath); if (children == null) { SFormUtil.resolveFieldType(instance.getType(), currentPath); return null; } instance = children; currentPath = currentPath.next(); } }
@Override final <T> T getValueWithDefaultIfNull(PathReader pathReader, Class<T> resultClass) { SInstance instance = getFieldLocalWithoutCreating(pathReader); if (instance != null) { return instance.getValueWithDefaultIfNull(pathReader.next(), resultClass); } SType<?> tipo = SFormUtil.resolveFieldType(getType(), pathReader); return tipo.getAttributeValueOrDefaultValueIfNull(resultClass); }
@Override final <T> T getValueWithDefaultIfNull(PathReader pathReader, Class<T> resultClass) { SInstance instance = getFieldLocalWithoutCreating(pathReader); if (instance != null) { return instance.getValueWithDefaultIfNull(pathReader.next(), resultClass); } SType<?> type = SFormUtil.resolveFieldType(getType(), pathReader); return type.getAttributeValueOrDefaultValueIfNull(resultClass); }
final <T> T getValue(PathReader pathReader, Class<T> resultClass) { SInstance instance = this; while (true) { if (pathReader.isEmpty()) { return instance.getValue(resultClass); } SInstance children = instance.getFieldLocalWithoutCreating(pathReader); if (children == null) { SFormUtil.resolveFieldType(instance.getType(), pathReader); return null; } instance = children; pathReader = pathReader.next(); } }