|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Documented @Target(value=TYPE) public @interface Region
Declares a new abstract region of state for the class to which this
annotation is applied. To declare more than one region for a class use the
Regions annotation.
It is a modeling error for a class to have both a Regions and a
Region annotation.
ObserverRegion, that includes the contents of the set
observers.
@Region("private ObserverRegion")
class Observer {
@Unique
@Aggregate("Instance into ObserverRegion")
private final Set<Callback> observers = new HashSet<Callback>()
...
}
A region, named AircraftState, that contains three long
fields use to represent the position of the object.
@Region("private AircraftState")
public class Aircraft {
@InRegion("AircraftState")
private long x, y;
@InRegion("AircraftState")
private long altitude;
...
}
A region, named ThingState, that contains two long fields use
to represent the position of a subclass. ThingState is empty in the
parent class Thing but has state added into it in the subclass
Player.
@Region("protected ThingState")
class Thing {
...
}
class Player extends Thing {
@InRegion("ThingState")
private long x, y;
...
}
@annotate tag.
/**
* @annotate Region("private AircraftState")
*/
public class Aircraft {
/**
* @annotate InRegion("AircraftState")
*/
private long x, y;
/**
* @annotate InRegion("AircraftState")
*/
private long altitude;
...
}
Aggregate,
AggregateInRegion,
InRegion,
Regions| Required Element Summary | |
|---|---|
String |
value
The value of this attribute must conform to the following grammar (in Augmented Backus–Naur Form): |
| Element Detail |
|---|
public abstract String value
value = accessModifiers IDENTIFIER ["extends" regionSpecification]
accessModifiers = ["public" / "protected" / "private"] [static]
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
As in Java, if neither public, protected, or private is declared then the region has default visibility; if static is not declared the region is an instance region.
If no explicit "extends" clause is provided the region extends from
region Instance if it is an instance region, or All if it
is a static region.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||