Package spoon.reflect

Interface CtModel

All Superinterfaces:
CtQueryable, Serializable
All Known Implementing Classes:
CtModelImpl

public interface CtModel extends Serializable, CtQueryable
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).
  • Method Details

    • getRootPackage

      CtPackage getRootPackage()
      returns the root package of the unnamed module
    • getAllTypes

      Collection<CtType<?>> getAllTypes()
      returns all top-level types of the model
    • getAllPackages

      Collection<CtPackage> getAllPackages()
      returns all packages of the model
    • getUnnamedModule

      CtModule getUnnamedModule()
      Returns the unnamed module.
    • getAllModules

      Collection<CtModule> getAllModules()
      returns all modules of the model
    • processWith

      void processWith(Processor<?> processor)
      process this model with the given processor
    • getElements

      <E extends CtElement> List<E> getElements(Filter<E> filter)
      Returns all the model elements matching the filter.
    • isBuildModelFinished

      boolean isBuildModelFinished()
      If true, the first build model has been finished. This value should be false at the beginning of SpoonModelBuilder.build() and true at this end.
    • setBuildModelIsFinished

      <T extends CtModel> T setBuildModelIsFinished(boolean buildModelFinished)
      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 SpoonModelBuilder.build()