当前页面:
在线文档首页 >
NetBeans API Javadoc (Current Development Version)
CreateFromTemplateHandler (Datasystems API) - NetBeans API Javadoc (Current Development Version)
org.openide.loaders
Class CreateFromTemplateHandler
java.lang.Object
org.openide.loaders.CreateFromTemplateHandler
public abstract class CreateFromTemplateHandler
- extends Object
This is an interface for smart templating
that allows
any module to intercept calls to DataObject.createFromTemplate(org.openide.loaders.DataFolder)
and handle them themselves. The NetBeans IDE provides default
implementation that allows use of Freemarker templating engine.
Read more in the howto document.
- Since:
- 6.1
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CreateFromTemplateHandler
public CreateFromTemplateHandler()
accept
protected abstract boolean accept(FileObject orig)
- Method that allows a handler to reject a file. If all handlers
reject a file, regular processing defined in
DataObject.handleCreateFromTemplate(org.openide.loaders.DataFolder, java.lang.String)
is going to take place.
- Parameters:
orig
- the file of the template
- Returns:
- true if this handler wants to handle the createFromTemplate operation
createFromTemplate
protected abstract FileObject createFromTemplate(FileObject orig,
FileObject f,
String name,
Map<String,Object> parameters)
throws IOException
- Handles the creation of new file.
- Parameters:
orig
- the source filef
- the folder to create a file inname
- the name of new file to create in the folderparameters
- map of additional arguments as specified by registered CreateFromTemplateAttributesProvider
s
- Returns:
- the newly create file
- Throws:
IOException
- if something goes wrong with I/O