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

spoon.reflect.declaration.CtClass Maven / Gradle / Ivy

Go to download

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

The newest version!
/* 
 * Spoon - http://spoon.gforge.inria.fr/
 * Copyright (C) 2006 INRIA Futurs 
 * 
 * This software is governed by the CeCILL-C License under French law and
 * abiding by the rules of distribution of free software. You can use, modify 
 * and/or redistribute the software under the terms of the CeCILL-C license as 
 * circulated by CEA, CNRS and INRIA at http://www.cecill.info. 
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
 * FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL-C License for more details.
 *  
 * The fact that you are presently reading this means that you have had
 * knowledge of the CeCILL-C license and that you accept its terms.
 */

package spoon.reflect.declaration;

import java.util.List;
import java.util.Set;

import spoon.reflect.code.CtStatement;
import spoon.reflect.reference.CtTypeReference;

/**
 * This element represents a class declaration.
 * 
 * @author Renaud Pawlak
 */
public interface CtClass extends CtType, CtStatement {

	/**
	 * Gets the fields defined by this class.
	 */
	List> getFields();

	/**
	 * Returns the anonymous blocks of this class.
	 */
	List getAnonymousExecutables();

	/**
	 * Returns the constructor of the class that takes the given argument types.
	 */
	CtConstructor getConstructor(CtTypeReference... parameterTypes);

	/**
	 * Returns the constructors of this class. This includes the default
	 * constructor if this class has no constructors explicitly declared.
	 */
	Set> getConstructors();

	/**
	 * Returns the class type directly extended by this class.
	 * 
	 * @return the class type directly extended by this class, or null if there
	 *         is none
	 */
	CtTypeReference getSuperclass();

	/**
	 * Sets the anonymous blocks of this class.
	 */
	void setAnonymousExecutables(List e);

	/**
	 * Add an anonymous block to this class.
	 * 
	 * @param e
	 * @return true if this element changed as a result of the call
	 */
	boolean addAnonymousExecutable(CtAnonymousExecutable e);

	/**
	 * Remove an anonymous block to this class.
	 * 
	 * @param e
	 * @return true if this element changed as a result of the call
	 */
	boolean removeAnonymousExecutable(CtAnonymousExecutable e);

	/**
	 * Sets the constructors for this class.
	 */
	void setConstructors(Set> constructors);

	/**
	 * Adds a constructor to this class.
	 */
	void addConstructor(CtConstructor constructor);

	/**
	 * Removes a constructor from this class.
	 */
	void removeConstructor(CtConstructor constructor);

	/**
	 * Sets the superclass type.
	 */
	void setSuperclass(CtTypeReference classType);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy