INRIA / INRIA/spoon

[suggestion]: add CtInterface.setPackage() to be used together with CtInterface.setSimpleName()

Open
#4,822 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

Q: is there an example, given a class, generate an interface for it?

ok, I tried to
```
CtInterface itfc = getFactory().createInterface();
itfc.setSimpleName(interfaceName);
...
clazz.addSuperInterface(itfc.getReference()); // added the new interface to an existing clazz
```

However in the output, I only get the "ExistingClass implements the NewInterface", but there is no output file for NewInterface.java itself.

so which call will write a generated CtInterface to disk file?

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.