On Wed, Jun 4, 2008 at 2:18 PM, simon <[EMAIL PROTECTED]> wrote:

>
> On Mon, 2008-06-02 at 21:57 -0500, Leonardo Uribe wrote:
> > Hi
> >
> > I have committed the changes.
>
> Thanks!
>
> >
> > Reading the email again, I forget to mention my opinion about change
> > "tagExcluded" setting to "ignore".
> >
> > In the plugin there are several levels of "ignore" (only two used in
> > practice):
> >
> > tagExcluded = true: generate the property with state saving and
> > restoring code on the .tld if applies, but do not generate on the Tag
> > class and do not include on the tld. It is also used to exclude
> > from .tld already defined properties.
> >
> > inheritedTag = true: assume that the code on Tag is inside the
> > hierarchy, and include on the tld.
> >
> > transient(never used)=generate property but do not included on
> > saveState and restoreState methods.
> >
> > I feel that "tagExcluded" or a similar name is more intuitive than
> > "ignore", according to the intention of the property.
>
> Ah..but I think the isRendered method should be overridden too.
>
> You said in an earlier email:
> <quote>
> override isRendered is bad, because this method is used on processXXX
> and encodeXXX methods
> </quote>
>
> I presume you meant that overriding it to throw an exception would not
> work. I agree, but would override it like this:
>
>  public boolean isRendered() {
>    return true;
>  }
>
> After all, if nobody is allowed to set the rendered state, then that is
> what will happen anyway, right?
>

Ok, I agree with you, so I'll add this code and commit it.


>
> And this makes it clear that there is no point in trying to save the
> rendered flag in saveState/restoreState etc. But it's not really
> "transient" state either; it's state that never should have existed.
> Which is why I think "ignore" would be a better name. But that's not so
> important.
>
> Sorry, but I didn't follow your description of "inheritedTag". What do
> you mean by "inside the hierarchy"?
>

"inheritedTag" is a variable of PropertyMeta used to check if a property has
already defined on a parent tag class. For example, UIComponentTag define
id, binding and rendered; HtmlCommandButtonTag extends from UIComponentTag,
but all properties on UICommand and HtmlCommandButton are not defined on
UIComponentTag, so this properties has " inheritedTag = "false" " but the
properties of UIComponent has " inheritedTag = "true" ".

The practical example where you use "inheritedTag" on a custom component (on
@JSFProperty or @JSFJspProperty) is when you want to insert a custom tag
class on the hierarchy (see
org.apache.myfaces.custom.suggestajax.AbstractSuggestAjaxTag). In this case
we define a new tagSuperclass. The definition of the component looks like
this:

/**
 * @JSFComponent
 *   configExcluded = "true"
 *   class = "org.apache.myfaces.custom.suggestajax.SuggestAjax"
 *   superClass =
"org.apache.myfaces.custom.suggestajax.AbstractSuggestAjax"
 *   tagClass = "org.apache.myfaces.custom.suggestajax.SuggestAjaxTag"
 *   tagSuperclass =
"org.apache.myfaces.custom.suggestajax.AbstractSuggestAjaxTag"
*/
public abstract class AbstractSuggestAjax extends HtmlInputText
    implements AjaxComponent, LocationAware

But on AbstractSuggestAjaxTag there is defined suggestedItemsMethod and
maxSuggestedItems, because it has a very specific code. inheritedTag is used
to tell the builder plugin that do not generate code on
org.apache.myfaces.custom.suggestajax.SuggestAjaxTag related to this
properties.

Other example when I use "inheritedTag" is this:

/*
 * @JSFValidator
 *   name = "s:validateCSV"
 *   tagClass = "org.apache.myfaces.custom.csvvalidator.ValidateCSVTag"
 *   tagSuperclass = "org.apache.myfaces.validator.ValidatorBaseTag"
 *   serialuidtag = "-8874279182242196266L"
 *
 * @JSFJspProperty name = "message" inheritedTag="true" returnType =
"java.lang.String" longDesc = "alternate validation error message format
string"
 */
public class CSVValidator extends ValidatorBase

Inheritance of properties for converters and validators are not supported
(in my concept there is no sense to allow this, but if there is a strong
reason we can study the impact and change it), so all properties defined on
the parent (in that case ValidatorBase) should be defined again with
inheritedTag="true".


>
> Regards,
> Simon
>
>

Reply via email to