Introduction

Paths are references to sources of data. They are similar in concept to file system paths used to access files or XPath expressions used to access data in a structured document. All access to data of any kind from a renderer is performed via paths. Paths can be used to access the values of server interface properties, text in localized properties files, localized properties resources in the database and other values. The terminology used to describe the parts of a path is shown in the figure below.

Figure 1. The Anatomy of a Path
  1. Prefix Path
  2. Selector
  3. Predicate
  4. Step
  5. Extended Path

The above path can be read as follows:

For more information about the general structure of paths and their manipulation in code, refer to the Javadoc for the Path and Step interfaces in the curam.util.common.path package.

The Field object passed to a render method contains a Binding object that specifies a source path and/or a target path. Renderer plug-ins do not need to be concerned about the form of these paths, or what type of data sources they reference; renderer plug-ins only need to resolve these paths to their values and should do so without inspecting the paths or depending on then being in any particular form. It is this unquestioning processing of any given path that allows renderer plug-ins to be reused easily in many different contexts and in rendering cascades.

Renderer plug-ins resolve paths the DataAccessor object available from the RendererContext object passed to the render method. There are a number of DataAccessor methods that can be called. They all take a single path argument:

get(Path)
Gets the formatted text value of the data. For domain-specific data, this is the value returned by the format method of the converter plug-in for that domain.s
getRaw(Path)
Gets the raw value of the data. For domain-specific data, this is the value passed to the format method of the converter plug-in. The type of the value is also the same as the type returned by the parse method of the converter plug-in.
getList(Path)
Gets the list of formatted text values of the data.
getRawList(Path)
Gets the list of raw values of the data.
count(Path)
Gets a count of the number of values that will be returned by getList or getRawList.

Where the data is not domain-specific, such as the contents of a properties file, the getRaw method usually returns the same string value as the get method. Some data sources may only support a subset of these methods. The get method is always supported, but the getList, getRawList and count methods may not be supported for all data sources. There are other methods on the DataAccessor, but their use is not supported in the Cúram application.