IP Library Granted Patent US 9,372,683
Granted Patent B2
US 9,372,683 · App. 13/603,954 · Granted Jun 21, 2016

Automatic generation of class identifiers from source code annotations

Inventor: Vojtech Szocs (Bratislava, SK)
Assignee: Red Hat Israel, Ltd.
G06F8/70G06F8/38G06F8/41G06F11/36G06F11/3624
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,372,683
App. No.
13/603,954
Granted
Jun 21, 2016
Kind
B2
Abstract

A method for generating identifiers for software components is provided. A processing device scans source code for an annotation associated with generating an identifier for an object. The processing device generates, using the annotation, an identifier value for the object. When the object does not have a previously assigned value, the processing device assigns the identifier value to the object. When the object has a previously assigned value, the processing device concatenates the identifier value to the previously assigned value of the object and assigns the concatenated identifier value to the object. The processing device then recursively descends into the sub-object's hierarchy by repeating the steps of scanning, generating, and assigning or concatenating and assigning described above.

Claims (51)

1. A method comprising:

scanning, by a processing device, source code for a first annotation associated with generating an identifier for a class;

generating, using the first annotation, a first identifier value for the class;

in response to the class not having a previously assigned identifier value, assigning the first identifier value to the class;

in response to the class having a previously assigned identifier value:

concatenating the first identifier value to the previously assigned identifier value to form a second identifier value, and

assigning the second identifier value to the class;

scanning, by the processing device, the source code for a second annotation associated with generating an identifier for a subclass of the class;

generating, using the second annotation, a third identifier value for the subclass, wherein the third identifier value is different than the first identifier value and is different than the second identifier value;

in response to the subclass not having a previously assigned identifier value, assigning the third identifier value to the subclass; and

in response to the subclass having a previously assigned identifier value:

concatenating the third identifier value to the previously assigned identifier value for the subclass, to form a fourth identifier value, and

assigning the fourth identifier value to the subclass.

2. The method of claim 1 , wherein the first identifier value is in view of a name of the class.

3. The method of claim 1 , wherein the class is a Java™ class.

4. The method of claim 1 , wherein the first annotation is a Java™ annotation associated with naming classes.

5. The method of claim 1 , wherein the first annotation is operable to assign an element value associated with the name of the class.

6. The method of claim 1 , wherein the class is associated with a visual component.

7. The method of claim 6 , wherein the visual component is a custom visual component.

8. The method of claim 1 , wherein the second identifier value comprises two strings separated by an underscore character.

9. The method of claim 1 , wherein the concatenating to form the second identifier value and the assigning of the second identifier value generates additional code for compilation.

10. A computer system, comprising:

a memory to store source code;

a processing device, operatively coupled to the memory, the processing device to:

scan the source code for a first annotation associated with generating an identifier for a class;

generate, using the first annotation, a first identifier value for the class;

in response to the class not having a previously assigned identifier value, assign the first identifier value to the class;

in response to the class object having a previously assigned value:

concatenate the first identifier value to the previously assigned identifier value to form a second identifier value, and

assign the second identifier value to the class;

scan the source code for a second annotation associated with generating an identifier for a subclass of the class;

generate, using the second annotation, a third identifier value for the subclass, wherein the third identifier value is different than the first identifier value and is different than the second identifier value;

in response to the subclass not having a previously assigned identifier value, assign the third identifier value to the subclass; and

in response to the subclass having a previously assigned identifier value:

concatenate the third identifier value to the previously assigned identifier value for the subclass, to form a fourth identifier value, and

assign the fourth identifier value to the subclass.

11. The computer system of claim 10 , wherein the first identifier value is in view of a name of the class.

12. A non-transitory computer-readable storage medium including instructions that, when accessed by a processing device, cause the processing device to:

scan, by the processing device, source code for a first annotation associated with generating an identifier for a class;

generate, using the first annotation, a first identifier value for the class;

in response to the class not having a previously assigned identifier value, assign the first identifier value to the class;

in response to the class having a previously assigned value:

concatenate the first identifier value to the previously assigned identifier value to form a second identifier value, and

assign the second identifier value to the class;

scan the source code for a second annotation associated with generating an identifier for a subclass of the class;

generate, using the second annotation, a third identifier value for the subclass, wherein the third identifier value is different than the first identifier value and is different than the second identifier value;

in response to the subclass not having a previously assigned identifier value, assign the third identifier value to the subclass; and

in response to the subclass having a previously assigned identifier value:

concatenate the third identifier value to the previously assigned identifier value for the subclass, to form a fourth identifier value, and

assign the fourth identifier value to the subclass.

13. The non-transitory computer-readable storage medium of claim 12 , wherein the first identifier value is in view of a name of the class.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2012
From: SZOCS, VOJTECH
To: RED HAT ISRAEL, LTD.
Reel/Frame 028927/0826 →
Continuity (1)
Related Publication 20140068559A1 · Mar 6, 2014