This class can be used to produce a "pretty" textual representation of a
DisambiguationReport.
It supports a simple templating mechanism to configure the representation's format.
In the
DisambiguationReport, a resource (either the resource being disambiguated or one of its parents)
is represented by an instance of
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
#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 \.