com.surelogic
Annotation Type TypeSet


@Documented
@Target(value=PACKAGE)
public @interface TypeSet

Declares a named set of types to be used in MayReferTo and Layer annotations. A type set is a global entity, and may be referred to by other annotations. Its name is qualified by the name of the package that it annotates. If the reference is within the same package, the name does not need to be qualified.

To place more than one TypeSet annotation on a package, use the TypeSets annotation. It is a modeling error for a package to have both a TypeSet and a TypeSets annotation.

Examples:

Declaring a typeset that represents a set of packages
 @TypeSet("IO = org.jdom+ | java.{io, net, util}")
 package example;
 
Declaring a typeset that consists of most, but not all of a package
 @TypeSet("UTIL = java.util & !(java.util.{Enumeration, Hashtable, Vector}")
 package example;
 

Javadoc usage notes:

 /**
  * @annotate TypeSet("IO = org.jdom+ | java.{io, net, util}")
  * @annotate TypeSet("UTIL = java.util & !(java.util.{Enumeration, Hashtable, Vector}")
  */
 package example;
 

See Also:
TypeSets

Required Element Summary
 String value
          The named set of types.
 

Element Detail

value

public abstract String value
The named set of types. This set is declared using a constructive syntax shared with the other annotations. The attribute is restricted to strings that match the following grammar:

value = name "=" 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 © 2010 Surelogic, Inc.. All Rights Reserved.