Remap field names and data values in a predicate string.
Namespace: NetricsServerInterface
Assembly: NetricsServerInterface (in NetricsServerInterface.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Class NetricsPredicateMapper |
C# |
---|
public class NetricsPredicateMapper |
C++ |
---|
ref class NetricsPredicateMapper |
J# |
---|
public class NetricsPredicateMapper |
JScript |
---|
public class NetricsPredicateMapper |
Remarks
The ANetricsQueryBuilder class tracks two sets of names:
- Output Field Names. These are the names sent to the Patterns server to reference a record field value. Within a Predicate String Expression it takes the form:
. Field name expressions cannot appear in string constants or other field name expressions. They appear only at the top level of the Predicate String Expression.$"field-name" - Input Data Names. These are the names of the input data items used to generate the query text. A standard Predicate String Expression has no representation for intput data items. This class extends the standard expression to add a means of specifying an input data item. It takes the form:
. All text between the curly braces is the name of the input data field. Input data items can appear both at the top level and within string constants.${data-item-name}
To allow the character sequence
to be expressed in a string constant (or elsewhere) the sequence
can be used to represent a single dollar sign that has no special meaning. This sequence is translated to a single dollar sign character by this class.
The ANetricsQueryBuilder class allows both the input and output field names to be updated at run time. This class must support these operations. It does so through the setFieldNames and setDataNames methods.
The class must also allow the data values to be inserted into the expression. The getMappedExpr method is used to retrieve the fully mapped Predicate String Expression.
When a data value is inserted into a predicate expression string constant the mapper will encode the value before inserting it. The value should not be encoded before passing it to the predicate expression mapper.
Some Things To Note:
This class does not validate the predicate expression syntax. If given an invalid predicate expression, it will quietly generate an invalid predicate expression.
A data item name may contain any character except a closing curly brace. This includes double quotes. So expressions of the form
are valid. Beware of:
: this is an unterminated string constant.
* Unterminated field names expressions or data item expressions are treated as fixed values. For example:
and
are both output exactly as is, as neither has a substitution section. The unterminated Field Name and Data sections are treated as if they were fixed text.
Inheritance Hierarchy
NetricsServerInterface.NetricsPredicateMapper