public interface CreateFromTemplateDecorator
CreateFromTemplateDecorator.isBeforeCreation()
and CreateFromTemplateDecorator.isAfterCreation()
return values. A decorator may perform both pre- and post-
processing.
First the decorator is asked to CreateFromTemplateDecorator.accept(org.netbeans.api.templates.CreateDescriptor)
the creation process; if it does not,
it will not be invoked at all. Before/after main file creation the CreateFromTemplateDecorator.decorate(org.netbeans.api.templates.CreateDescriptor, java.util.List<org.openide.filesystems.FileObject>)
method is called to perform its magic. Any reported additional files will be returned
as part of FileBuilder.build()
result.Modifier and Type | Method and Description |
---|---|
boolean |
accept(CreateDescriptor desc)
Determines whether the decorator is willing to participate in creation.
|
List<FileObject> |
decorate(CreateDescriptor desc,
List<FileObject> createdFiles)
Extends the creation process.
|
boolean |
isAfterCreation()
Determines if the decorator should be called after template processing.
|
boolean |
isBeforeCreation()
Determines if the decorator should be called before template processing.
|
boolean isBeforeCreation()
boolean isAfterCreation()
boolean accept(CreateDescriptor desc)
false
, its CreateFromTemplateDecorator.decorate(org.netbeans.api.templates.CreateDescriptor, java.util.List<org.openide.filesystems.FileObject>)
will not be called. Itdesc
- describes the request that is about to be performed@CheckForNull List<FileObject> decorate(@NonNull CreateDescriptor desc, @NonNull List<FileObject> createdFiles) throws IOException
null
.desc
- command objects that describes the file creation requestcreatedFiles
- files created so far as part of the template creationIOException
- if something goes wrong with I/O