Skip to content

Instantly share code, notes, and snippets.

@pauldijou
Created June 21, 2012 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauldijou/2967186 to your computer and use it in GitHub Desktop.
Save pauldijou/2967186 to your computer and use it in GitHub Desktop.
Generating methods on CDK
// Abstract component inside CDK. Will serve as base to generate final UIComponent.
@JsfComponent(...)
public abstract class AbstractInput extends UIInput implements CoreProps, UIComponentUtil {
...
}
// Implementation for the #hasFacet() method
return getFacet(facetName) != null;
// Interface that provide the signature of the method to add to CDK Abstract components
public interface UIComponentUtil {
@GeneratedMethod("hasFacet.ftl")
boolean hasFacet(String facetName);
}
// 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;
}
...
}
@bleathem
Copy link

Is there a RFSBOX jira for this?

@pauldijou
Copy link
Author

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.

@pauldijou
Copy link
Author

@bleathem
Copy link

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