Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section describes key classes which are essential while using Slice. They constitute a base for a day-to-day development.

...

ModelProvider allows you to fetch either a single object of a specified class or a list of objects of a specified class. During execution of methods of this interface, the execution context is modified, meaning that the specified path is put on the top of the execution stack. This allows other objects to inject the specified resource (or path) and use it as a current resource. Read more about execution stack stack here.

Below table describes methods of the interface.

...

Anchor
Deprecated
Deprecated
@Deprecated API

Few API members have been deprecated in Slice 4.0 and should be avoided where possible.

DeprecatedSuggestion

com.cognifide.slice.api.provider.ChildrenProvider


Use one of ModelProvider's methods:

  • <T> List<T> getChildModels(Class<T> type, String parentPath);
  • <T> List<T> getChildModels(Class<T> type, Resource parentResource);
  • <T> List<T> getList(Class<T> type, String[] paths);
  • <T> List<T> getList(Class<T> type, Iterator<String> paths);

com.cognifide.slice.api.provider.ModelProvider

  • getChildren(String path)
  • getChildResources(String path)
Use Resource.listChildren()
com.cognifide.slice.api.link.*

Whole package (link API) has been removed in Slice 4.0.0

If your code is dependent on it, feel free to extract code from Slice 3.2.0 source code: https://github.com/Cognifide/Slice/tree/3.2.0

...