Class ConditionClause


  • public class ConditionClause
    extends Object
    Represents a clause in a condition.
    • 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()
        Returns true iff 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()
        Returns true iff the clause method is resolved.
        Returns:
        true iff 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()