As a transitional step, this site will temporarily be made Read-Only from July 8th until the new community launch. During this time, you can still search and read articles and discussions.

While the community is read-only, if you have questions or issues requiring TIBCO review/response, please access the new TIBCO Community and select "Ask A Question."

You will need to register or log in or register to engage in the new community.

Using Property Names with the TIBCO Spotfire® Document Model Framework API

Last updated:
12:51am May 10, 2017

Overview

This page describes how to use property names with the TIBCO Spotfire® Document Model Framework API.

Each custom DocumentNode class must have an inner class called PropertyNames containing identifiers for public and internal properties:

  • If the node class derives from DocumentNode, the class should derive from DocumentNode.PropertyNames.
     
  • If the class derives from a sub class to DocumentNode, the property name class shall derive from
    [DocumentNode sub class].PropertyNames.

Implementation Pattern

Suppose we have a sealed document node class Example with the public property Title and the internal property NumberOfTicks, then the PropertyName class is defined as follows:

public sealed class Example : DocumentNode
{
    ...
    public new sealed class PropertyNames : DocumentNode.PropertyNames
    {
       public static readonly PropertyName Title = CreatePropertyName("Title");
       internal static readonly PropertyName NumberOfTicks = CreatePropertyName("NumberOfTicks");
    }
    ...
}

 
If the class is not sealed, the PropertyNames class should be made abstract. The string that is passed into the PropertyName constructor is used as a key in the serialization of the node and should by convention be the same as the name of the property. That is, it should use Pascal casing.

If the class contains private properties they should not be added to the PropertyNames class. Instead create a private class called, by convention, PrivatePropertyNames. The class should contain one public static field for each private property.