|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Documented
@Target(value={TYPE,CONSTRUCTOR,METHOD,FIELD})
public @interface AllowsReferencesFromConstrains the set of types that are allowed to reference the annotated program element. This annotation may target a type, a method, a constructor, or a field.
package com.surelogic.smallworld.model;
public class Place {
@AllowsReferencesFrom("World")
Place(World world, String name, String description) { ... }
...
}
The constructor for the Place class shown above is allowed, by the
Java language, to be invoked from any type within the com.surelogic.smallworld.model package. The AllowsReferencesFrom
annotation restricts this visibility further to only the World class.
@annotate tag.
public class Place {
/**
* @annotate AllowsReferencesFrom("World")
*/
Place(World world, String name, String description) { ... }
...
}
MayReferTo,
TypeSet| Required Element Summary | |
|---|---|
String |
value
The set of types that may refer to the type. |
| Element Detail |
|---|
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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||