Skip to content

Commit 0fd494d

Browse files
committed
Update Annotations Javadocs
1 parent 62a28a3 commit 0fd494d

File tree

12 files changed

+86
-24
lines changed

12 files changed

+86
-24
lines changed

liquidjava-api/src/main/java/liquidjava/specification/ExternalRefinementsFor.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@
66
import java.lang.annotation.Target;
77

88
/**
9-
* Annotation to create refinements for an external library. The annotation receives the path of the
10-
* library e.g. @ExternalRefinementsFor("java.lang.Math")
9+
* Annotation to refine a class or interface of an external library
10+
* e.g. `@ExternalRefinementsFor("java.lang.Math")`
1111
*
1212
* @author catarina gamboa
1313
*/
1414
@Retention(RetentionPolicy.RUNTIME)
1515
@Target({ElementType.TYPE})
1616
public @interface ExternalRefinementsFor {
17+
1718
/**
18-
* The prefix of the external method
19-
*
20-
* @return
19+
* The fully qualified name of the class or interface for which the refinements are being defined
2120
*/
2221
public String value();
2322
}

liquidjava-api/src/main/java/liquidjava/specification/Ghost.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
import java.lang.annotation.Target;
88

99
/**
10-
* Annotation to create a ghost variable for a class. The annotation receives
11-
* the type and name of
12-
* the ghost within a string e.g. @Ghost("int size")
10+
* Annotation to create a ghost variable for a class or interface
11+
* e.g. `@Ghost("int size")`
1312
*
1413
* @author catarina gamboa
1514
*/
1615
@Retention(RetentionPolicy.RUNTIME)
1716
@Target({ElementType.TYPE})
1817
@Repeatable(GhostMultiple.class)
1918
public @interface Ghost {
19+
20+
/**
21+
* The type and name of the ghost variable
22+
*/
2023
public String value();
2124
}

liquidjava-api/src/main/java/liquidjava/specification/GhostMultiple.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
import java.lang.annotation.Target;
77

88
/**
9-
* Annotation to allow the creation of multiple @Ghost
9+
* Annotation to allow the creation of multiple `@Ghost` annotations in a class or interface
10+
* e.g. `@GhostMultiple({@Ghost("int size"), @Ghost("boolean isEmpty")})`
1011
*
1112
* @author catarina gamboa
1213
*/
1314
@Retention(RetentionPolicy.RUNTIME)
1415
@Target({ElementType.TYPE})
1516
public @interface GhostMultiple {
17+
18+
/**
19+
* The array of `@Ghost` annotations to be created
20+
*/
1621
Ghost[] value();
1722
}

liquidjava-api/src/main/java/liquidjava/specification/Refinement.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@
66
import java.lang.annotation.Target;
77

88
/**
9-
* Annotation to add a refinement to variables, class fields, method's parameters and method's
10-
* return value e.g. @Refinement("x > 0") int x;
9+
* Annotation to add a refinement to variables, class fields, method's parameters and method's return values
10+
* e.g. `@Refinement("x > 0") int x;`
1111
*
1212
* @author catarina gamboa
1313
*/
1414
@Retention(RetentionPolicy.RUNTIME)
1515
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.PARAMETER, ElementType.TYPE})
1616
public @interface Refinement {
1717

18+
/**
19+
* The refinement string
20+
*/
1821
public String value();
1922

23+
/**
24+
* An optional message to be included in the error message when the refinement is violated
25+
*/
2026
public String msg() default "";
2127
}

liquidjava-api/src/main/java/liquidjava/specification/RefinementAlias.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@
77
import java.lang.annotation.Target;
88

99
/**
10-
* Annotation to create a ghost variable for a class. The annotation receives the type and name of
11-
* the ghost within a string e.g. @RefinementAlias("Nat(int x) {x > 0}")
10+
* Annotation to create a refinement alias
11+
* e.g. `@RefinementAlias("Nat(int x) { x > 0 }")`
1212
*
1313
* @author catarina gamboa
1414
*/
1515
@Retention(RetentionPolicy.RUNTIME)
1616
@Target({ElementType.TYPE})
1717
@Repeatable(RefinementAliasMultiple.class)
1818
public @interface RefinementAlias {
19+
20+
/**
21+
* The refinement alias string, which includes the name of the alias, its parameters and the refinement itself
22+
*/
1923
public String value();
2024
}

liquidjava-api/src/main/java/liquidjava/specification/RefinementAliasMultiple.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
import java.lang.annotation.Target;
77

88
/**
9-
* Annotation to create a multiple Alias in a class
9+
* Annotation to create multiple refinement aliases
10+
* e.g. `@RefinementAliasMultiple({@RefinementAlias("Nat(int x) { x > 0 }"), @RefinementAlias("Pos(int x) { x >= 0 }")})`
1011
*
1112
* @author catarina gamboa
1213
*/
1314
@Retention(RetentionPolicy.RUNTIME)
1415
@Target({ElementType.TYPE})
1516
public @interface RefinementAliasMultiple {
17+
18+
/**
19+
* The array of `@RefinementAlias` annotations to be created
20+
*/
1621
RefinementAlias[] value();
1722
}

liquidjava-api/src/main/java/liquidjava/specification/RefinementPredicate.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@
66
import java.lang.annotation.RetentionPolicy;
77
import java.lang.annotation.Target;
88

9+
/**
10+
* Annotation that allows the creation of ghosts or refinement aliases
11+
* e.g. `@RefinementPredicate("ghost int size")`, `@RefinementPredicate("type Nat(int x) { x > 0 }")`
12+
*
13+
* @author catarina gamboa
14+
*/
915
@Retention(RetentionPolicy.RUNTIME)
1016
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
1117
@Repeatable(RefinementPredicateMultiple.class)
1218
public @interface RefinementPredicate {
19+
20+
/**
21+
* The refinement predicate string, which can define a ghost variable or a refinement alias
22+
*/
1323
public String value();
1424
}

liquidjava-api/src/main/java/liquidjava/specification/RefinementPredicateMultiple.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@
55
import java.lang.annotation.RetentionPolicy;
66
import java.lang.annotation.Target;
77

8+
/**
9+
* Annotation to allow the creation of multiple `@RefinementPredicate` annotations
10+
* e.g. `@RefinementPredicateMultiple({`@RefinementPredicate("ghost int size")`, `@RefinementPredicate("type Nat(int x) { x > 0 }")`})`
11+
*
12+
* @author catarina gamboa
13+
*/
814
@Retention(RetentionPolicy.RUNTIME)
915
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
1016
public @interface RefinementPredicateMultiple {
17+
18+
/**
19+
* The array of `@RefinementPredicate` annotations to be created
20+
*/
1121
RefinementPredicate[] value();
1222
}

liquidjava-api/src/main/java/liquidjava/specification/StateRefinement.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,28 @@
77
import java.lang.annotation.Target;
88

99
/**
10-
* Annotation to create state transitions in a method. The annotation has three arguments: from : the
11-
* state in which the object needs to be for the method to be invoked correctly to : the state in
12-
* which the object will be after the execution of the method msg : optional custom error message to display when refinement is violated
13-
* e.g. @StateRefinement(from="open(this)", to="closed(this)")
10+
* Annotation to create state transitions in a method
11+
* e.g. `@StateRefinement(from="open(this)", to="closed(this)", msg="The object needs to be open before closing")`
1412
*
1513
* @author catarina gamboa
1614
*/
1715
@Retention(RetentionPolicy.RUNTIME)
1816
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
1917
@Repeatable(StateRefinementMultiple.class)
2018
public @interface StateRefinement {
19+
20+
/**
21+
* The state in which the object needs to be before calling the method
22+
*/
2123
public String from() default "";
2224

25+
/**
26+
* The state in which the object will be after calling the method
27+
*/
2328
public String to() default "";
2429

30+
/**
31+
* Optional custom error message to be included in the error message when the `from` is violated
32+
*/
2533
public String msg() default "";
2634
}

liquidjava-api/src/main/java/liquidjava/specification/StateRefinementMultiple.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
import java.lang.annotation.Target;
77

88
/**
9-
* Interface to allow multiple state refinements in a method. A method can have a state refinement
10-
* for each set of different source and destination states
9+
* Annotation to allow the creation of multiple `@StateRefinement` annotations
10+
* e.g. `@StateRefinementMultiple({@StateRefinement(from="open(this)", to="closed(this)"), @StateRefinement(from="closed(this)", to="open(this)")})`
1111
*
1212
* @author catarina gamboa
1313
*/
1414
@Retention(RetentionPolicy.RUNTIME)
1515
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
1616
public @interface StateRefinementMultiple {
17+
18+
/**
19+
* The array of `@StateRefinement` annotations to be created
20+
*/
1721
StateRefinement[] value();
1822
}

0 commit comments

Comments
 (0)