If you want your class to make certain variables configurable from a properties file, the class should make those variables into properties (see Using Nucleus: Property Names in this chapter).
For example, to make the variable age
into a configurable integer, your class should declare a property for age
like this:
int age;
public void setAge (int age) { this.age = age; }
public int getAge () { return age; }
Exposing a variable as a property also makes that variable available for inspection at runtime through the Nucleus administrator.
You may also wish to make a property read-only, meaning that it can only be inspected at runtime, but cannot be configured through a properties file. This technique is often used for properties that contain runtime statistics. To make a property read-only, simply omit the setX
function:
int age;
public int getAge () { return age; }
If you want to view a read-only property in the Properties tab of the Component Editor, check the Include read-only properties box in the Properties tab.