@Documented @Retention(value=RUNTIME) @Target(value=TYPE) public @interface MayReferTo
@MayReferTo("com.surelogic.smallworld.model | org.jdom+ | java.{io, net, util}")
class Example { ... }
The class Example is allowed to reference any type in the
com.surelogic.smallworld.model package, any type in the
org.jdom package and its subpackages, and any type any type in the
UTIL typeset, and any type in the java.io, java.net,
and java.util packages.
Declaring that this type is allowed to reference most, but not all of a
package.
@MayReferTo("java.util & !(java.util.{Enumeration, Hashtable, Vector}")
class Example2 { ... }
The class Example2 is allowed to reference all the types in the
java.util package except for the Enumeration,
Hashtable, and Vector classes.
@annotate tag.
/**
* @annotate MayReferTo("java.util")
*/
class Example { ... }
public abstract String value
value = type_set_expr
type_set_expr = type_set_disjunct *("|" type_set_disjunct) ; Set union
type_set_disjunct = type_set_conjunct *("&" type_set_conjunct) ; Set intersection
type_set_conjunct = ["!"] type_set_leaf ; Set complement
type_set_leaf = dotted_name ; Package name, layer name, type name, or
type set name
type_set_leaf /= dotted_name "+" ; Package tree
type_set_leaf /= dotted_name "." "{" name *(",
" name) "}" ; Union of packages/types
type_set_leaf /= "(" type_set_expr ")"
The union, intersection, and complement operators, as well as the
parentheses have the obvious meanings, and standard precedence order. A
package name signifies all the types in that package; a named type
indicates a specific type. A named layer stands for all the types in the
layer. A named type set stands for the type set specified by the given
name, as defined by a @TypeSet annotation. The package tree suffix
"+" indicates that all the types in the package and its
subpackages are part of the set. The braces "{" "}" are
syntactic sugar used to enumerate a union of packages/types that share the
same prefix.
Copyright © 2012 Surelogic, Inc.. All Rights Reserved.