All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spoon.reflect.code.CtFor Maven / Gradle / Ivy

Go to download

Spoon is a tool for meta-programming, analysis and transformation of Java programs.

There is a newer version: 11.1.1-beta-14
Show newest version
/*
 * SPDX-License-Identifier: (MIT OR CECILL-C)
 *
 * Copyright (C) 2006-2023 INRIA and contributors
 *
 * Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon.
 */
package spoon.reflect.code;

import spoon.reflect.annotations.PropertyGetter;
import spoon.reflect.annotations.PropertySetter;

import java.util.List;

import static spoon.reflect.path.CtRole.EXPRESSION;
import static spoon.reflect.path.CtRole.FOR_INIT;
import static spoon.reflect.path.CtRole.FOR_UPDATE;

/**
 * This code element defines a for loop.
 * Example:
 * 
 *     // a for statement
 *     for(int i=0; i<10; i++) {
 *     	System.out.println("foo");
 *     }
 * 
*/ public interface CtFor extends CtLoop { /** * Gets the end-loop test expression. */ @PropertyGetter(role = EXPRESSION) CtExpression getExpression(); /** * Sets the end-loop test expression. */ @PropertySetter(role = EXPRESSION) T setExpression(CtExpression expression); /** * Gets the init statements. */ @PropertyGetter(role = FOR_INIT) List getForInit(); /** * Adds an init statement. */ @PropertySetter(role = FOR_INIT) T addForInit(CtStatement statement); /** * Sets the init statements. */ @PropertySetter(role = FOR_INIT) T setForInit(List forInit); /** * Removes an init statement. */ @PropertySetter(role = FOR_INIT) boolean removeForInit(CtStatement statement); /** * Gets the update statements. */ @PropertyGetter(role = FOR_UPDATE) List getForUpdate(); /** * Adds an update statement. */ @PropertySetter(role = FOR_UPDATE) T addForUpdate(CtStatement statement); /** * Sets the update statements. */ @PropertySetter(role = FOR_UPDATE) T setForUpdate(List forUpdate); /** * Removes an update statement. */ @PropertySetter(role = FOR_UPDATE) boolean removeForUpdate(CtStatement statement); @Override CtFor clone(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy