CodeGenerationSettings settings,
IField getter,
IField setter)
throws Exception
{
AddGetterSetterOperation op = new AddGetterSetterOperation(
type,
getter != null ? new IField[]{getter} : NO_FIELDS,
setter != null ? new IField[]{setter} : NO_FIELDS,
NO_FIELDS,
ASTUtils.getCompilationUnit(src), null, sibling, settings, true, true);
op.run(null);
TextEdit edit = op.getResultingEdit();
if (edit != null){
JavaUtils.format(
src, CodeFormatter.K_COMPILATION_UNIT,
edit.getOffset(), edit.getLength());
}