Created
June 21, 2012 17:31
-
-
Save pauldijou/2967186 to your computer and use it in GitHub Desktop.
Generating methods on CDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Abstract component inside CDK. Will serve as base to generate final UIComponent. | |
@JsfComponent(...) | |
public abstract class AbstractInput extends UIInput implements CoreProps, UIComponentUtil { | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implementation for the #hasFacet() method | |
return getFacet(facetName) != null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Interface that provide the signature of the method to add to CDK Abstract components | |
public interface UIComponentUtil { | |
@GeneratedMethod("hasFacet.ftl") | |
boolean hasFacet(String facetName); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated UIComponent by the CDK from the Abstract one, including the generated method from the UIComponentUtil interface. | |
@Generated({"RichFaces CDK", "4.3.0-SNAPSHOT"}) | |
public class UIInput extends AbstractInput implements CoreProps, UIComponentUtil { | |
... | |
public boolean hasFacet(String facetName) { | |
return getFacet(facetName) != null; | |
} | |
... | |
} |
Is there a RFSBOX jira for this?
Nope, the idea is brand new from a talk between Lukas and myself this afternoon. I can create it tomorrow with this gist as reference is you want.
JIRA issue created : https://issues.jboss.org/browse/RF-12339
Great Paul - thanks for your terrific ideas moving the project forward!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fine with me, I'm always fine when you provide more tools but don't force people to use them. I'm not sure if it will be so much usefull, but for small methods, it will clearly increase productivity and readability.