com.surelogic
Annotation Type AggregateInRegion


@Documented
@Target(value=FIELD)
public @interface AggregateInRegion

Declares that the Instance region of the object referenced by this field is to be mapped into a named region of the object that contains the field to which this annotation is applied.

It is a modeling error if the field declaration is not also annotated with Unique. It is a modeling error if the field declaration is also annotated with Aggregate.

Examples:

The below class defines a region, called ObserverRegion, that includes the integer notifyCounter and the state referenced by the observers field (i.e., the internals of the HashSet object).
 @Region("private ObserverRegion")
 class Observer {

   @InRegion("ObserverRegion")
   private int notifyCounter = 0;

   @Unique
   @AggregateInRegion("ObserverRegion")
   private final Set<Callback> observers = new HashSet<Callback>()
   ...
 }
 

Javadoc usage notes:

This annotation may placed in Javadoc, which can be useful for Java 1.4 code which does not include language support for annotations, via the @annotate tag.
 /**
  * @annotate Region("private ObserverRegion")
  */
 class Observer {

   /**
    * @annotate InRegion("ObserverRegion")
    */
   private int notifyCounter = 0;

   /**
    * @annotate Unique
    * @annotate AggregateInRegion("ObserverRegion")
    */
   private final Set<Callback> observers = new HashSet<Callback>()
   ...
 }
 

See Also:
Aggregate, Unique

Required Element Summary
 String value
          The value of this attribute indicates the region that the Instance region of the object referenced by this field is to be mapped or "aggregated" into.
 

Element Detail

value

public abstract String value
The value of this attribute indicates the region that the Instance region of the object referenced by this field is to be mapped or "aggregated" into. The value of this attribute must conform to the following grammar (in Augmented Backus–Naur Form):
 value = regionSpecification
 
 regionSpecification = simpleRegionSpecificaion / qualifiedRegionName
 
 simpleRegionSpecification = IDENTIFIER / "[" "]"                ; Region of the class being annotated
 
 qualifedRegionName =  IDENTIFIER *("." IDENTIFIER) : IDENTIFER  ; Static region from the named, optionally qualified, class
 
 IDENTIFIER = Legal Java Identifier
 



Copyright © 2010 Surelogic, Inc.. All Rights Reserved.