Package org.gcontracts.generation

Examples of org.gcontracts.generation.PreconditionGenerator


    private void generatePrecondition(ProcessingContextInformation processingContextInformation, ClassNode classNode, MethodNode methodNode) {
        if (!processingContextInformation.isPreconditionsEnabled()) return;
        if (!CandidateChecks.isPreconditionCandidate(classNode, methodNode)) return;
        if (processingContextInformation.contract().preconditions().contains(methodNode)) return;

        final PreconditionGenerator preconditionGenerator = new PreconditionGenerator(processingContextInformation.readerSource());
        preconditionGenerator.generateDefaultPreconditionStatement(classNode, methodNode);
    }
View Full Code Here


    public void injectPrecondition(final MethodNode method, final Precondition precondition) {
        if (!pci.isPreconditionsEnabled() || !CandidateChecks.isPreconditionCandidate(method.getDeclaringClass(), method)) return;

        final ReaderSource source = pci.readerSource();
        final PreconditionGenerator preconditionGenerator = new PreconditionGenerator(source);

        preconditionGenerator.generatePreconditionAssertionStatement(method, precondition);
    }
View Full Code Here

TOP

Related Classes of org.gcontracts.generation.PreconditionGenerator

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.