beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie O'Neil <>
Subject Re: plugging in additional apt processors for annotations
Date Wed, 09 Nov 2005 06:31:55 GMT

  Do you have a specific use-case in mind?

  That sort of compile-time checking could work in some control client
situations, but it would be a somewhat constrained set of control
usages.  The issue is that a control could be hosted in an arbitrary
number of environments, and not all may use the @Control annotation to
instantiate the control.

  Would it make more sense to have the control do runtime checks to
ensure that it's running in what it considers to be a "valid"

  While build-time might be convenient, it's not always possible to
infer all usages and as such, those checks would be somewhat brittle
and would ultimately lead to false-positive builds.

  To address your general question, one of the limitations of the Java
5.0 annotation processors (APs) is that they consume annotations, so
they are visible to exactly one AP.  Would be great to be able to
chain together APs, but today, this requires custom infrastructure in
the APs to define and execute their own chains.  One could argue that
this should be value that Beehive adds as some core infrastructure
that is shared across Beehive sub-projects, but that's a longer term
conversation.  :)


On 11/8/05, Jim Cummings <> wrote:
> I have a number of situations where I would like to do compile-time checks
> to see if annotations are used in proper contexts. For example, is an
> annotation (possibly in a nested control) being used within a call-chain
> rooted in an environment (say a Pageflow) that the annotation does not
> support or doesn't make sense in?
> I was thinking of using an annotation processor to detect @Control or
> @ControlReference annotations in a class which is a pageflow controller, and
> walking down the nested control dependency chain to inspect any referenced
> controls to make sure the annotation is used properly. But it looks like apt
> will only allow a single processor to register for each annotation.
> Does anyone know how to accomplish this kind of compile-time check in apt or
> Beehive another way?
> If not, could Beehive's TwoPhaseAnnotationProcessor be enhanced to allow
> other annotation processors to plug-in somehow, allowing third-parties to do
> additional checking on Beehive annotations like @Control?
> Thanks! - Jim.

View raw message