jass.modern
Annotation Type Invariant


@Documented
@Target(value={FIELD,TYPE})
@Retention(value=CLASS)
public @interface Invariant

The class invariant assertion. It can be placed at type members (classes, interfaces, ...) and fields.

Author:
riejo

Required Element Summary
 String value
          The value of this invariant.
 
Optional Element Summary
 Context context
          An invariant can be used in static and instance contexts or in instance only contexts.
 String msg
          A message which is printed in case this invariant is violated.
 Visibility visibility
          The Visibility of this invariant.
 

Element Detail

value

@Code(translator={jass.modern.core.compile.transform.QuantifierTransformer.class,jass.modern.core.compile.transform.ModelVariableTransformer.class})
public abstract String value
The value of this invariant. It must be valid Java code which evaluates to a boolean.

Returns:
The expression of this invariant.

msg

public abstract String msg
A message which is printed in case this invariant is violated. The default value is the empty string.

Returns:
The violation message of this invariant.
See Also:
Throwable.getMessage()
Default:
""

visibility

public abstract Visibility visibility
The Visibility of this invariant. Note, that for instance the visibility of a private field may not be public.

Returns:
The visibiliy of this invariant which is not allowd to be greater ('more public') then its target.
Default:
jass.modern.Visibility.TARGET

context

public abstract Context context
An invariant can be used in static and instance contexts or in instance only contexts.

Returns:
Default:
jass.modern.Context.INSTANCE