public final class LayerBuilder.File
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
LayerBuilder.File |
boolvalue(java.lang.String attr,
boolean value) |
Adds a boolean-valued attribute.
|
LayerBuilder.File |
bundlevalue(java.lang.String attr,
java.lang.String label) |
Adds an attribute for a possibly localized string.
|
LayerBuilder.File |
bundlevalue(java.lang.String attr,
java.lang.String label,
java.lang.annotation.Annotation annotation,
java.lang.String annotationMethod) |
Adds an attribute for a possibly localized string.
|
LayerBuilder.File |
bundlevalue(java.lang.String attr,
java.lang.String bundle,
java.lang.String key) |
Adds an attribute loaded from a resource bundle.
|
LayerBuilder.File |
bytevalue(java.lang.String attr,
byte value) |
Adds a byte-valued attribute.
|
LayerBuilder.File |
charvalue(java.lang.String attr,
char value) |
Adds a character-valued attribute.
|
LayerBuilder.File |
contents(java.lang.String contents) |
Configures the file to have inline text contents.
|
LayerBuilder.File |
doublevalue(java.lang.String attr,
double value) |
Adds a double-valued attribute.
|
LayerBuilder.File |
floatvalue(java.lang.String attr,
float value) |
Adds a float-valued attribute.
|
java.lang.String |
getPath() |
Gets the path this file is to be created under.
|
LayerBuilder.File |
instanceAttribute(java.lang.String attr,
java.lang.Class<?> type) |
Adds an attribute to load the associated class or method.
|
LayerBuilder.File |
instanceAttribute(java.lang.String attr,
java.lang.Class<?> type,
java.lang.annotation.Annotation annotation,
java.lang.String annotationMethod) |
Adds an attribute to load the associated class or method.
|
LayerBuilder.File |
intvalue(java.lang.String attr,
int value) |
Adds an int-valued attribute.
|
LayerBuilder.File |
longvalue(java.lang.String attr,
long value) |
Adds a long-valued attribute.
|
LayerBuilder.File |
methodvalue(java.lang.String attr,
java.lang.String clazz,
java.lang.String method) |
Adds an attribute loaded from a Java method.
|
LayerBuilder.File |
newvalue(java.lang.String attr,
java.lang.String clazz) |
Adds an attribute loaded from a Java constructor.
|
LayerBuilder.File |
position(int position) |
Sets a position attribute.
|
LayerBuilder.File |
serialvalue(java.lang.String attr,
byte[] data) |
Adds an attribute which deserializes a Java value.
|
LayerBuilder.File |
shortvalue(java.lang.String attr,
short value) |
Adds a short-valued attribute.
|
LayerBuilder.File |
stringvalue(java.lang.String attr,
java.lang.String value) |
Adds a string-valued attribute.
|
LayerBuilder.File |
url(java.lang.String url) |
Configures the file to have external contents.
|
LayerBuilder.File |
urlvalue(java.lang.String attr,
java.lang.String value) |
Adds a URL-valued attribute.
|
LayerBuilder.File |
urlvalue(java.lang.String attr,
java.net.URI value) |
Adds a URL-valued attribute.
|
LayerBuilder |
write() |
Writes the file or folder to the layer.
|
public java.lang.String getPath()
LayerBuilder.file(java.lang.String)public LayerBuilder.File contents(java.lang.String contents)
contents - text to use as the body of the filepublic LayerBuilder.File url(java.lang.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(java.lang.String attr, java.lang.String value)
attr - the attribute namevalue - the attribute valuepublic LayerBuilder.File bytevalue(java.lang.String attr, byte value)
attr - the attribute namevalue - the attribute valuepublic LayerBuilder.File shortvalue(java.lang.String attr, short value)
attr - the attribute namevalue - the attribute valuepublic LayerBuilder.File intvalue(java.lang.String attr, int value)
attr - the attribute namevalue - the attribute valuepublic LayerBuilder.File longvalue(java.lang.String attr, long value)
attr - the attribute namevalue - the attribute valuepublic LayerBuilder.File floatvalue(java.lang.String attr, float value)
attr - the attribute namevalue - the attribute valuepublic LayerBuilder.File doublevalue(java.lang.String attr, double value)
attr - the attribute namevalue - the attribute valuepublic LayerBuilder.File boolvalue(java.lang.String attr, boolean value)
attr - the attribute namevalue - the attribute valuepublic LayerBuilder.File charvalue(java.lang.String attr, char value)
attr - the attribute namevalue - the attribute valuepublic LayerBuilder.File urlvalue(java.lang.String attr, java.net.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 valuepublic LayerBuilder.File urlvalue(java.lang.String attr, java.lang.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 opaquepublic LayerBuilder.File methodvalue(java.lang.String attr, java.lang.String clazz, java.lang.String method)
attr - the attribute nameclazz - the fully-qualified binary name of the factory classmethod - the name of a static methodpublic LayerBuilder.File newvalue(java.lang.String attr, java.lang.String clazz)
attr - the attribute nameclazz - the fully-qualified binary name of a class with a no-argument constructorpublic LayerBuilder.File instanceAttribute(java.lang.String attr, java.lang.Class<?> type) throws java.lang.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 checkjava.lang.IllegalArgumentException - if the associated element is not a class or methodLayerGenerationException - if the associated element would not be loadable as an instance of the specified typepublic LayerBuilder.File instanceAttribute(java.lang.String attr, java.lang.Class<?> type, java.lang.annotation.Annotation annotation, java.lang.String annotationMethod) throws java.lang.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 checkannotation - as in LayerGenerationException(String,Element,ProcessingEnvironment,Annotation,String)annotationMethod - as in LayerGenerationException(String,Element,ProcessingEnvironment,Annotation,String)java.lang.IllegalArgumentException - if the associated element is not a class or methodLayerGenerationException - if the associated element would not be loadable as an instance of the specified typepublic LayerBuilder.File bundlevalue(java.lang.String attr, java.lang.String bundle, java.lang.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 bundlepublic LayerBuilder.File bundlevalue(java.lang.String attr, java.lang.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 sourcespublic LayerBuilder.File bundlevalue(java.lang.String attr, java.lang.String label, java.lang.annotation.Annotation annotation, java.lang.String annotationMethod) 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)annotation - as in LayerGenerationException(String,Element,ProcessingEnvironment,Annotation,String)annotationMethod - as in LayerGenerationException(String,Element,ProcessingEnvironment,Annotation,String)LayerGenerationException - if a bundle key is requested but it cannot be found in sourcespublic LayerBuilder.File serialvalue(java.lang.String attr, byte[] data)
attr - the attribute namedata - the serial data as created by ObjectOutputStreampublic 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 positionpublic LayerBuilder write()
Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.