Java Elements reference


Table 53: Java element properties
Property
Description
Classes
Display name of classes (using a combination of plain text and substitution codes).
Constructors
Display name of constructors (using a combination of plain text and substitution codes).
Fields
Display name of fields (using a combination of plain text and substitution codes).
Initializers
Display name of initializers (using a combination of plain text and substitution codes).
Interfaces
Display name of interfaces (using a combination of plain text and substitution codes).
Methods
Display name of methods (using a combination of plain text and substitution codes).
Table 54: Substitution Codes for the Java Elements properties
Substitution Code
Type of substituted text
{m}
Element's modifiers (for all elements except initializers).
{n}
Element's name (for all elements except initializers).
{C}
Name of class with all outerclasses (for classes and interfaces only).
{f}
Full name of element with package (for all elements except initializers).
{t}
Type (for fields only).
{r}
Return type (for methods and constructors).
{s}
Superclass (for classes only).
{c}
Static (for initializers only).
{p}
Parameters with types but not variable names (for constructors and methods).
{a}
Parameters with types and names (for constructors and methods ).
{i}
Interfaces implemented or extended (for classes and interfaces only).
{e}
Exceptions (for constructors and methods only).
<initializer>
Initializer.

Advanced substitution formats

You can also use advanced substitution formats with these substitution codes to create a more informative display name for the elements in the Explorer and Object Browser.

For simple arguments (arguments that do not contain lists of items), you can create a code in the format:

 {SubstitutionCode,prefix,suffix}

where prefix represents a string to appear before the element name and suffix represents a string to appear after it. If there is nothing to replace the substitution code with, the prefix and suffix parameters are ignored. If you want to use a comma in the prefix or suffix, enclose the string in double quote (") marks.

For example, to display information about exceptions on method nodes, you could use the expression

 {n}{e, throws ,}

If the method does not contain exception code, only the method name is displayed. If there is exception code, the following is displayed:

 methodName throws exceptionName

You can display the {p}, {a}, {i}, and {e} codes in the following array format:

 {SubstitutionCode,prefix,suffix,delimiter}

where delimiter represents the text that separates the parameters.

For example, for Methods, you could enter

 {n}{p, (,),", "}

to display the method name and then the parameters of the method in parentheses. If there is more than one parameter, the parameters will be delimited with commas. If there are no parameters, only the method name will be displayed.


Contents Prev Next Index