IP Library Granted Patent US 9,471,282
Granted Patent B2
US 9,471,282 · App. 11/689,276 · Granted Oct 18, 2016

System and method for using annotations to automatically generate a framework for a custom javaserver faces (JSF) component

Inventors: Erukala Arpana (Hyderabad, IN); Amit Chaturvedi (Hyderabad, IN)
Assignee: CA, Inc.
G06F8/30G06F8/24
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,471,282
App. No.
11/689,276
Granted
Oct 18, 2016
Kind
B2
Abstract

A system and method for using annotations to automatically generate a framework for a custom JavaServer Faces (JSF) component is provided. Source code for a custom JSF Component class may be received, where the received source code may include annotations indicating how a declared element should be processed. For example, based on a type of annotation in the source code, the framework for the custom JSF component may be automatically generated, where the generated framework can include implementations for a Component class, a Tag Handler class, a Renderer class, a Tag Library Descriptor, a faces-config.xml file, tag unit test cases, or any other aspect of a custom JSF component. Thus, reusable, reliable, and readable custom JSF components may be easily developed at a substantially reduced development cost.

Claims (45)

1. A method to create a custom JavaServer Faces (JSF) component, the method comprising:

receiving annotated source code that defines a component class for the custom JSF component of a JSF application, the annotated source code being Java code of a Java class that defines behavior of a user interface element in a web page, the custom JSF component being callable by a custom tag in a markup language document at least in part defining the web page, the annotated source code including a Java annotation designated by an @ symbol prefix corresponding to a renderer; and

creating the custom JSF component, at least in part, by:

identifying the annotation in the received source code; and

in response to identifying the annotation, automatically generating a default decode method of the renderer that interprets inputs related to the custom JSF component and associating the renderer with the custom JSF component in a faces-config.xml file of the JSF application without manually adding a reference to the custom JSF component to the faces-config.xml file of the JSF application.

2. The method of claim 1 , wherein automatically generating the custom JSF component comprises generating a framework for the custom JSF component and automatically adding a reference to the custom JSF component to the faces-config.xml file.

3. The method of claim 1 , wherein the source code comprises another annotation identifying a data validator to validate inputs to the web page via the user interface element of the custom JSF component, and wherein automatically generating the custom JSF component comprises automatically registering the data validator as a validator usable to the JSF application in response to identifying the other annotation in the source code.

4. The method of claim 1 , wherein the source code comprises another annotation corresponding to a renderer, and wherein automatically generating the custom JSF component comprises automatically associating the renderer with the custom JSF component in response to identifying the other annotation in the annotated source code.

5. The method of claim 1 , wherein creating the custom JSF component comprises accessing a reflective application program interface (API) that provides a source-based view of program structure.

6. The method of claim 1 , wherein creating the custom JSF component comprises generating both Java source code and related extensible markup language with a Java factory responsive to a plurality of annotations in the source code, the generated Java code including a unit test for the custom JSF component.

7. The method of claim 1 , wherein creating the custom JSF component comprises:

performing steps for automatically generating a framework for the custom JSF component.

8. The method of claim 1 , wherein the source code comprises another annotation designating a tag to be added to the JSF application, and wherein creating the custom JSF component comprises:

identifying the annotation designating the tag in the source code; and

in response to identifying the annotation designating the tag, generating Java code defining both a getter method and setter method corresponding to the tag designated by the annotation designating the tag.

9. The method of claim 1 , comprising:

providing a web application to a client device, at least part of the web application including markup generated by a renderer of the custom JSF component based on an output of the custom JSF component.

10. The method of claim 1 , wherein creating the custom JSF component comprises:

generating Java code defining tag handler class responsive to one or more annotations in the annotated source code;

generating Java code defining both getter and setter methods for an attribute of the custom JSF component responsive to one or more annotations in the annotated source code;

generating extensible markup language (XML) defining a tag library descriptor responsive to one or more annotations in the annotated source code;

generating XML to be added to the faces-config.xml file responsive to one or more annotations in the annotated source code; and

obtaining manual edits or configuration of the custom JSF component.

11. A non-transitory computer-readable medium containing computer-executable instructions to automatically generate a custom JavaServer Faces (JSF) component, the instructions operable when executed by one or more computers to effectuate operations comprising:

receiving annotated source code that defines a component class for the custom JSF component of a JSF application, the annotated source code being Java code of a Java class that defines behavior of a user interface element in a web page, the custom JSF component being callable by a custom tag in a markup language document at least in part defining the web page, the annotated source code including a Java annotation designated by an @ symbol prefix corresponding to a renderer; and

creating the custom JSF component, at least in part, by:

identifying the annotation in the received source code; and

in response to identifying the annotation, automatically generating a default decode method of the renderer that interprets inputs related to the custom JSF component and associating the renderer with the custom JSF component in a faces-config.xml file of the JSF application without manually adding a reference to the custom JSF component to the faces-config.xml file of the JSF application.

12. The computer-readable medium of claim 11 , wherein automatically generating the custom JSF component comprises generating a framework for the custom JSF component and automatically adding a reference to the custom JSF component to the faces-config.xml file.

13. The computer-readable medium of claim 11 , wherein the source code comprises another annotation identifying a data validator to validate inputs to the web page via the user interface element of the custom JSF component, and wherein automatically generating the custom JSF component comprises automatically registering the data validator as a validator usable to the JSF application in response to identifying the other annotation in the source code.

14. The computer-readable medium of claim 11 , wherein the source code comprises another annotation corresponding to a renderer, and wherein automatically generating the custom JSF component comprises automatically associating the renderer with the custom JSF component in response to identifying the other annotation in the annotated source code.

15. The computer-readable medium of claim 11 , wherein creating the custom JSF component comprises accessing a reflective application program interface (API) that provides a source-based view of program structure.

16. The computer-readable medium of claim 11 , wherein creating the custom JSF component comprises generating both Java source code and related extensible markup language with a Java factory responsive to a plurality of annotations in the source code, the generated Java code including a unit test for the custom JSF component.

17. The computer-readable medium of claim 11 , wherein creating the custom JSF component comprises:

performing steps for automatically generating a framework for the custom JSF component.

18. The computer-readable medium of claim 11 , wherein the source code comprises another annotation designating a tag to be added to the JSF application, and wherein creating the custom JSF component comprises:

identifying the annotation designating the tag in the source code; and

in response to identifying the annotation designating the tag, generating Java code defining both a getter method and setter method corresponding to the tag designated by the annotation designating the tag.

19. The computer-readable medium of claim 11 , comprising:

providing a web application to a client device, at least part of the web application including markup generated by a renderer of the custom JSF component based on an output of the custom JSF component.

20. The computer-readable medium of claim 11 , wherein creating the custom JSF component comprises:

generating Java code defining tag handler class responsive to one or more annotations in the annotated source code;

generating Java code defining both getter and setter methods for an attribute of the custom JSF component responsive to one or more annotations in the annotated source code;

generating extensible markup language (XML) defining a tag library descriptor responsive to one or more annotations in the annotated source code; and

generating XML to be added to the faces-config.xml file responsive to one or more annotations in the annotated source code.

Assignments (2)
MERGER Recorded Jul 3, 2013
From: COMPUTER ASSOCIATES THINK, INC.
To: CA, INC.
Reel/Frame 030736/0301 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 18, 2007
From: ARPANA, E.; CHATURVEDI, AMIT
To: COMPUTER ASSOCIATES THINK, INC.
Reel/Frame 019443/0492 →
Continuity (1)
Related Publication 20080235661A1 · Sep 25, 2008