What is the difference between what you want to do here and "package protected" that is standard in java (e.g. not using private, protected or public modifiers) ?

regards,

Wim

2009/10/8 Matthew Adams <matthew@xxxxxxxxxxxxxxx>

Hi all,

Java has fused the concept of "namespace" and "component" in its
concept of "package". This results in having to mark public things
that you really don't want public consumers to access. .NET actually
fixes this with its "protected internal" scope: only code from within
the current assembly can access the member scoped as protected
internal.

Now, I have a declare error statement attempting to achieve
functionality similar to C#'s "protected internal" scope, whereby only
code from within the current package is allowed to access the thing
that is annotated with @ProtectedInternal.

Here is my annotation & my declare error statement, but I'd like to
make it more general, replacing "org.foo.model.*" with something more
general that implies that access is disallowed from code that is
outside the called/accessed element's package, that is, not in the
annotated element's package.