Difference between revisions of "Globalyzer 5 Java Rules"

From Lingoport Wiki
Jump to: navigation, search
(Code Snippet)
(User Interface)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
   
= User Interface =
+
= User Interface =
  +
[File:RS with Class or Variable Type.png]
   
 
= Type of Rules =
 
= Type of Rules =

Revision as of 15:31, 27 October 2015

Introduction

User Interface

[File:RS with Class or Variable Type.png]

Type of Rules

Example

Code Snippet

import company.util.Dbg;  // A fully qualified class name
import company.project.*; // Label is in the company.project package.
 [...]
 Dbg dbg = Dbg.getInstance();
 Label lbl = new Label();
 [...]
 dbg.setText("{0}: {1} action taken.");
 [...]
 label.setText("Menu");


This snippet of code does have strings.

The class company.project.Dbg is a debug class and the text method puts the String parameter into a database for support purposes. That string is not visible to the end user. In that instance, the setText method on a variable of type company.project.Dbg should be filtered.

The variable lbl of class company.project.Label represents a text area in the User Interface and the setText method passes a user visible string. The string Menu passed to this setText method should be flagged: It needs to be externalized out of the code into a resource bundle.

Rule

Result