Class ConditionClause
- java.lang.Object
-
- ch.usi.si.codelounge.jsicko.plugin.ConditionClause
-
public class ConditionClause extends Object
Represents a clause in a condition.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.sun.tools.javac.util.List<ConditionClause>createInvariants(com.sun.tools.javac.util.List<com.sun.tools.javac.code.Symbol.MethodSymbol> invariants, JavacUtils javac, ch.usi.si.codelounge.jsicko.plugin.JSickoContractCompilerState state)Statically constructs a set of invariant clauses from annotated method symbols.static com.sun.tools.javac.util.List<ConditionClause>from(Contract.Ensures postconditionAnnotation, com.sun.tools.javac.code.Symbol declaringSymbol, JavacUtils javac, ch.usi.si.codelounge.jsicko.plugin.JSickoContractCompilerState state)Statically constructs clauses from a set of ensures annotations.static com.sun.tools.javac.util.List<ConditionClause>from(Contract.Requires preconditionAnnotation, com.sun.tools.javac.code.Symbol declaringSymbol, JavacUtils javac, ch.usi.si.codelounge.jsicko.plugin.JSickoContractCompilerState state)Statically constructs clauses from a set of requires annotations.Optional<Integer>getArity()StringgetClauseRep()Returns the clause representation.ContractConditionEnumgetConditionType()Returns the condition type where the clause is used.com.sun.tools.javac.util.NamegetMethodName()Returns the name of the clause method.StringgetResolvedClauseRepWithNames()Returns the clause representation with explicit param names.booleanisClauseMethodStatic()booleanisNegated()Returnstrueiff the clause is negated.booleanisResolved()Returnstrueiff the clause method is resolved.StringtoString()
-
-
-
Method Detail
-
getClauseRep
public String getClauseRep()
Returns the clause representation.- Returns:
- the clause representation.
-
getResolvedClauseRepWithNames
public String getResolvedClauseRepWithNames()
Returns the clause representation with explicit param names.- Returns:
- the clause representation with explicit param names for the clause method and the declaring method.
-
isNegated
public boolean isNegated()
Returnstrueiff the clause is negated.- Returns:
- the negates status of the clause.
-
getMethodName
public com.sun.tools.javac.util.Name getMethodName()
Returns the name of the clause method.- Returns:
- the name of the clause method.
-
getConditionType
public ContractConditionEnum getConditionType()
Returns the condition type where the clause is used.- Returns:
- the condition type.
-
isResolved
public boolean isResolved()
Returnstrueiff the clause method is resolved.- Returns:
trueiff the compiler resolved the clause method.
-
from
public static com.sun.tools.javac.util.List<ConditionClause> from(Contract.Ensures postconditionAnnotation, com.sun.tools.javac.code.Symbol declaringSymbol, JavacUtils javac, ch.usi.si.codelounge.jsicko.plugin.JSickoContractCompilerState state)
Statically constructs clauses from a set of ensures annotations.- Parameters:
postconditionAnnotation- a postcondition annotation.declaringSymbol- a symbol annotated with the postconditions.- Returns:
- a list of condition clauses.
-
from
public static com.sun.tools.javac.util.List<ConditionClause> from(Contract.Requires preconditionAnnotation, com.sun.tools.javac.code.Symbol declaringSymbol, JavacUtils javac, ch.usi.si.codelounge.jsicko.plugin.JSickoContractCompilerState state)
Statically constructs clauses from a set of requires annotations.- Parameters:
preconditionAnnotation- a precondition annotation.declaringSymbol- a symbol annotated with the preconditions.- Returns:
- a list of condition clauses.
-
createInvariants
public static com.sun.tools.javac.util.List<ConditionClause> createInvariants(com.sun.tools.javac.util.List<com.sun.tools.javac.code.Symbol.MethodSymbol> invariants, JavacUtils javac, ch.usi.si.codelounge.jsicko.plugin.JSickoContractCompilerState state)
Statically constructs a set of invariant clauses from annotated method symbols.- Parameters:
invariants- a set of method symbols representing class invariants.javac- the javac utility object.- Returns:
- a list of condition clauses.
-
isClauseMethodStatic
public boolean isClauseMethodStatic()
-
-