Package org.gcontracts.generation

Examples of org.gcontracts.generation.PostconditionGenerator


*/
public class PostconditionLifecycle extends BaseLifecycle {

    @Override
    public void beforeProcessingClassNode(ProcessingContextInformation processingContextInformation, ClassNode classNode) {
        final PostconditionGenerator postconditionGenerator = new PostconditionGenerator(processingContextInformation.readerSource());
        postconditionGenerator.addOldVariablesMethod(classNode);
    }
View Full Code Here


    private void generatePostcondition(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode methodNode) {
        if (!processingContextInformation.isPostconditionsEnabled()) return;
        if (!CandidateChecks.isPostconditionCandidate(classNode, methodNode)) return;

        final PostconditionGenerator postconditionGenerator = new PostconditionGenerator(processingContextInformation.readerSource());

        if (!(methodNode instanceof ConstructorNode) && AnnotationUtils.getAnnotationNodeInHierarchyWithMetaAnnotation(classNode, methodNode, ClassHelper.makeWithoutCaching(Postcondition.class)).size() > 0)  {
            postconditionGenerator.generateDefaultPostconditionStatement(classNode, methodNode);
        } else {
            postconditionGenerator.generateDefaultPostconditionStatement(classNode, methodNode);
        }
    }
View Full Code Here

    public void injectPostcondition(final MethodNode method, final Postcondition postcondition) {
        if (!pci.isPostconditionsEnabled() || !CandidateChecks.isPostconditionCandidate(method.getDeclaringClass(), method)) return;

        final ReaderSource source = pci.readerSource();
        final PostconditionGenerator postconditionGenerator = new PostconditionGenerator(source);

        postconditionGenerator.generatePostconditionAssertionStatement(method, postcondition);
    }
View Full Code Here

TOP

Related Classes of org.gcontracts.generation.PostconditionGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.