This class can be used to produce a "pretty" textual representation of a {@link DisambiguationReport}. It supports a simple templating mechanism to configure the representation's format.
In the {@link DisambiguationReport}, a resource (either the resource being disambiguated or one of its parents) is represented by an instance of {@link org.rhq.core.domain.resource.composite.DisambiguationReport.Resource}. The template uses this instance and its properties:
- id - the resource id
- name - the name of the resource
- type - the type of the resource
- name - the name of the resource type
- plugin - the name of the plugin defining the resource type
- singleton - a boolean whether the resource type is a singleton type or not
The template has the following format:
...text...%([..text...])?<identifier>([...text...])?...text...
It is best explained by an example. The {@link #DEFAULT_SEGMENT_TEMPLATE default segment template} looks like this:
%type.name[ ]%[(]type.plugin[) ]%name
The %type.name[ ]
is rendered as the name of the resource type followed by a space IF the resource type and the name are not null. If either of them is null %type.name[ ]
renders as an empty string.
%[(]type.plugin[) ]
renders as a bracket followed by the name of the plugin followed by a bracket and a space if both resource type and plugin are not null. If either of them is null, again the whole %...
is rendered as an empty string.
The escape character is \.
@author Lukas Krejci