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

spoon.reflect.CtModel 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;

import spoon.SpoonModelBuilder;
import spoon.processing.Processor;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.declaration.CtModule;
import spoon.reflect.declaration.CtPackage;
import spoon.reflect.declaration.CtType;
import spoon.reflect.visitor.Filter;
import spoon.reflect.visitor.chain.CtQueryable;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/** represents a Java program, modeled by a set of compile-time (Ct) objects
 * where each object is a program element (for instance, a CtClass represents a class).
 */
public interface CtModel extends Serializable, CtQueryable {

	/** returns the root package of the unnamed module */
	CtPackage getRootPackage();

	/** returns all top-level types of the model */
	Collection> getAllTypes();

	/** returns all packages of the model */
	Collection getAllPackages();

	/**
	 * Returns the unnamed module.
	 */
	CtModule getUnnamedModule();

	/**
	 * returns all modules of the model
	 */
	Collection getAllModules();

	/** process this model with the given processor */
	void processWith(Processor processor);

	/** Returns all the model elements matching the filter. */
	 List getElements(Filter filter);

	/**
	 * If true, the first build model has been finished.
	 * This value should be false at the beginning of {@link SpoonModelBuilder#build()} and true at this end.
	 */
	boolean isBuildModelFinished();

	/**
	 * Set to true to flag that a build model has been finished.
	 * By default, this method is called with a true value at the end of {@link SpoonModelBuilder#build()}
	 */
	 T setBuildModelIsFinished(boolean buildModelFinished);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy