|
org.openide.filesystems 7.21.1 1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openide.filesystems.annotations.LayerBuilder.File
public final class LayerBuilder.File
Builder for creating a single file entry.
| Method Summary | |
|---|---|
LayerBuilder.File |
boolvalue(String attr,
boolean value)
Adds a boolean-valued attribute. |
LayerBuilder.File |
bundlevalue(String attr,
String label)
Adds an attribute for a possibly localized string. |
LayerBuilder.File |
bundlevalue(String attr,
String bundle,
String key)
Adds an attribute loaded from a resource bundle. |
LayerBuilder.File |
bytevalue(String attr,
byte value)
Adds a byte-valued attribute. |
LayerBuilder.File |
charvalue(String attr,
char value)
Adds a character-valued attribute. |
LayerBuilder.File |
contents(String contents)
Configures the file to have inline text contents. |
LayerBuilder.File |
doublevalue(String attr,
double value)
Adds a double-valued attribute. |
LayerBuilder.File |
floatvalue(String attr,
float value)
Adds a float-valued attribute. |
String |
getPath()
Gets the path this file is to be created under. |
LayerBuilder.File |
instanceAttribute(String attr,
Class type)
Adds an attribute to load the associated class or method. |
LayerBuilder.File |
intvalue(String attr,
int value)
Adds an int-valued attribute. |
LayerBuilder.File |
longvalue(String attr,
long value)
Adds a long-valued attribute. |
LayerBuilder.File |
methodvalue(String attr,
String clazz,
String method)
Adds an attribute loaded from a Java method. |
LayerBuilder.File |
newvalue(String attr,
String clazz)
Adds an attribute loaded from a Java constructor. |
LayerBuilder.File |
position(int position)
Sets a position attribute. |
LayerBuilder.File |
serialvalue(String attr,
byte[] data)
Adds an attribute which deserializes a Java value. |
LayerBuilder.File |
shortvalue(String attr,
short value)
Adds a short-valued attribute. |
LayerBuilder.File |
stringvalue(String attr,
String value)
Adds a string-valued attribute. |
LayerBuilder.File |
url(String url)
Configures the file to have external contents. |
LayerBuilder.File |
urlvalue(String attr,
String value)
Adds a URL-valued attribute. |
LayerBuilder.File |
urlvalue(String attr,
URI value)
Adds a URL-valued attribute. |
LayerBuilder |
write()
Writes the file to the layer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public String getPath()
LayerBuilder.file(java.lang.String)public LayerBuilder.File contents(String contents)
contents - text to use as the body of the file
public LayerBuilder.File url(String url)
url - a URL to the body of the file, e.g. "nbresloc:/org/my/module/resources/definition.xml"
or more commonly an absolute resource path such as "/org/my/module/resources/definition.xml"
public LayerBuilder.File stringvalue(String attr,
String value)
attr - the attribute namevalue - the attribute value
public LayerBuilder.File bytevalue(String attr,
byte value)
attr - the attribute namevalue - the attribute value
public LayerBuilder.File shortvalue(String attr,
short value)
attr - the attribute namevalue - the attribute value
public LayerBuilder.File intvalue(String attr,
int value)
attr - the attribute namevalue - the attribute value
public LayerBuilder.File longvalue(String attr,
long value)
attr - the attribute namevalue - the attribute value
public LayerBuilder.File floatvalue(String attr,
float value)
attr - the attribute namevalue - the attribute value
public LayerBuilder.File doublevalue(String attr,
double value)
attr - the attribute namevalue - the attribute value
public LayerBuilder.File boolvalue(String attr,
boolean value)
attr - the attribute namevalue - the attribute value
public LayerBuilder.File charvalue(String attr,
char value)
attr - the attribute namevalue - the attribute value
public LayerBuilder.File urlvalue(String attr,
URI value)
throws LayerGenerationException
attr - the attribute namevalue - the attribute value, e.g. "/my/module/resource.html"
or "nbresloc:/my/module/resource.html"; relative values permitted
but not likely useful as base URL would be e.g. "jar:...!/META-INF/"
LayerGenerationException - in case an opaque URI is passed as value
public LayerBuilder.File urlvalue(String attr,
String value)
throws LayerGenerationException
attr - the attribute namevalue - the attribute value, e.g. "/my/module/resource.html"
or "nbresloc:/my/module/resource.html"; relative values permitted
but not likely useful as base URL would be e.g. "jar:...!/META-INF/"
LayerGenerationException - in case value cannot be parsed as a URI or is opaque
public LayerBuilder.File methodvalue(String attr,
String clazz,
String method)
attr - the attribute nameclazz - the fully-qualified binary name of the factory classmethod - the name of a static method
public LayerBuilder.File newvalue(String attr,
String clazz)
attr - the attribute nameclazz - the fully-qualified binary name of a class with a no-argument constructor
public LayerBuilder.File instanceAttribute(String attr,
Class type)
throws IllegalArgumentException,
LayerGenerationException
LayerGeneratingProcessors which define layer fragments which instantiate Java objects from the annotated code.
attr - the attribute nametype - a type to which the instance ought to be assignable, or null to skip this check
IllegalArgumentException - if the associated element is not a class or method
LayerGenerationException - if the associated element would not be loadable as an instance of the specified type
public LayerBuilder.File bundlevalue(String attr,
String bundle,
String key)
attr - the attribute namebundle - the full name of the bundle, e.g. "org.my.module.Bundle"key - the key to look up inside the bundle
public LayerBuilder.File bundlevalue(String attr,
String label)
throws LayerGenerationException
attr - the attribute namelabel - either a general string to store as is, or a resource bundle reference
such as "my.module.Bundle#some_key",
or just "#some_key" to load from a "Bundle"
in the same package as the element associated with this builder (if exactly one)
LayerGenerationException - if a bundle key is requested but it cannot be found in sources
public LayerBuilder.File serialvalue(String attr,
byte[] data)
attr - the attribute namedata - the serial data as created by ObjectOutputStream
public LayerBuilder.File position(int position)
int position() default Integer.MAX_VALUE;
and later call:
fileBuilder.position(annotation.position())
position - a numeric position for this file, or Integer.MAX_VALUE to not define any position
public LayerBuilder write()
|
org.openide.filesystems 7.21.1 1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||