|
org.openide.filesystems 7.38.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openide.filesystems.annotations.LayerBuilder
public final class LayerBuilder
Convenience class for generating fragments of an XML layer.
LayerGeneratingProcessor.layer(javax.lang.model.element.Element...)
Nested Class Summary | |
---|---|
class |
LayerBuilder.File
Builder for creating a single file entry. |
Method Summary | |
---|---|
LayerBuilder.File |
file(String path)
Adds a file to the layer. |
LayerBuilder.File |
folder(String path)
Adds a folder to the layer. |
LayerBuilder.File |
instanceFile(String path,
String name)
Generates an instance file that is not initialized with an instance. |
LayerBuilder.File |
instanceFile(String path,
String name,
Class type)
Generates an instance file whose InstanceCookie would load the associated class or method. |
LayerBuilder.File |
shadowFile(String target,
String folder,
String name)
Convenience method to create a shadow file (like a symbolic link). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public LayerBuilder.File file(String path)
LayerBuilder.File.write()
it in order to finalize the effect.
path
- the full path to the desired file in resource format, e.g. "Menu/File/exit.instance"
public LayerBuilder.File folder(String path)
LayerBuilder.File.write()
it in order to finalize the effect.
Normally just using file(java.lang.String)
suffices, since parent folders are
created as needed, but you may use this method if you wish to create a folder
(possibly with some attributes) without necessarily creating any children.
path
- the full path to the desired folder in resource format, e.g. "Menu/File"
public LayerBuilder.File instanceFile(String path, String name, Class type) throws IllegalArgumentException, LayerGenerationException
InstanceCookie
would load the associated class or method.
Useful for LayerGeneratingProcessor
s which define layer fragments which instantiate Java objects from the annotated code.
While you can pick a specific instance file name, if possible you should pass null for name
as using the generated name will help avoid accidental name collisions between annotations.
path
- path to folder of instance file, e.g. "Menu/File"
name
- instance file basename, e.g. "my-menu-Item"
, or null to pick a name according to the elementtype
- a type to which the instance ought to be assignable, or null to skip this check
LayerBuilder.File.write()
to finalize)
IllegalArgumentException
- if the builder is not associated with exactly one
class or method
LayerGenerationException
- if the associated element would not be loadable as an instance of the specified typepublic LayerBuilder.File instanceFile(String path, String name) throws IllegalArgumentException, LayerGenerationException
LayerGeneratingProcessor
s which define layer fragments
which indirectly instantiate Java objects from the annotated code via a generic factory method.
Invoke the factory using LayerBuilder.File.methodvalue(java.lang.String, java.lang.String, java.lang.String)
on instanceCreate
and configure it with a LayerBuilder.File.instanceAttribute(java.lang.String, java.lang.Class)
appropriate to the factory.
While you can pick a specific instance file name, if possible you should pass null for name
as using the generated name will help avoid accidental name collisions between annotations.
path
- path to folder of instance file, e.g. "Menu/File"
name
- instance file basename, e.g. "my-menu-Item"
, or null to pick a name according to the element
LayerBuilder.File.write()
to finalize)
IllegalArgumentException
- if the builder is not associated with exactly one
class or method
LayerGenerationException
- if the associated element would not be loadable as an instancepublic LayerBuilder.File shadowFile(String target, String folder, String name)
While you can pick a specific shadow file name, if possible you should pass null for name
as using the generated name will help avoid accidental name collisions between annotations.
target
- the complete path to the original file (use LayerBuilder.File.getPath()
if you just made it)folder
- the folder path in which to create the shadow, e.g. "Menu/File"
name
- the basename of the shadow file sans extension, e.g. "my-Action"
, or null to pick a default
LayerBuilder.File.write()
to finalize)
|
org.openide.filesystems 7.38.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |