@Target(value=TYPE) @Retention(value=SOURCE) public @interface GenerateEmbeddedDSL
where() field. They can be referenced
by enclosing their name in angle brackets (<>). Named subexpressions
can be referenced by other named subexpressions, but their must not be any cyclic dependencies
between named subexpressions.
| regex | ::= | union-regex |
| union-regex | ::= | concat-regex (| concat-regex)* |
| concat-regex | ::= | mod-regex mod-regex* | mod-regex | ::= | mod-regex (?|*|+) | atomic-regex |
| atomic-regex | ::= | ( regex ) | identifier | < identifier > |
An identifier is a string consisting of alphanumeric characters and _ only, and beginning with an alphabetic character or _.
| Modifier and Type | Required Element and Description |
|---|---|
String |
name
The simple (i.e., unqualified) name of the EDSL class to generate.
|
String |
syntax
The syntax of the embedded DSL, specified as a regular expression.
|
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
autoVarArgs
Automatically generate variable argument overloads for all suitable
methods.
|
boolean |
classPublic
Specifies whether the generated DSL class should be declared as
public. |
com.github.misberner.apcommons.util.Visibility |
delegateConstructorVisibility
Controls the visibility of the delegate constructor, i.e., the constructor which takes
an instance of the DSL implementation as argument.
|
boolean |
enableAllMethods
Automatically treat all methods (excluding those defined by the
Object class) as actions of the embedded DSL. |
boolean |
forwardAllConstructors
Controls whether to automatically generate forwards for all visible constructors.
|
com.github.misberner.apcommons.util.Visibility |
forwardConstructorVisibility |
boolean |
includeInherited
Consider inherited methods as potential DSL actions.
|
com.github.misberner.apcommons.util.AFModifier |
modifier
Specifies whether the generated DSL class should be declared as
final. |
boolean |
nonVoidTerminators
The default setting is
false. |
String |
packageName
The package in which the generated EDSL class will be placed.
|
SubExpr[] |
where
Named subexpressions that can be used in the embedded DSL syntax definition.
|
public abstract String name
public abstract String syntax
See above for a syntax definition for regular expressions.
public abstract String packageName
The value is interpreted as a package reference relative to the implementation class annotated with this annotation:
The default value is ".".
public abstract boolean classPublic
public. If set
to false, it will have package-private visibility.
The default setting is true.
public abstract com.github.misberner.apcommons.util.AFModifier modifier
final. If set to
false, it will be non-final.
The default setting is false.
public abstract SubExpr[] where
Named subexpressions are referenced by their name, enclosed in angle brackets (< and >). Subexpressions may reference other subexpressions, but there must not be any cyclic dependencies between subexpressions.
Subexpressions are specified as regular expressions. See above for a syntax definition for regular expressions.
The default value is {}, meaning that no subexpressions are declared.
public abstract boolean autoVarArgs
The global behavior can be overridden on a per-method basis by setting
DSLAction.autoVarArgs().
The default setting is true.
public abstract boolean nonVoidTerminators
The default setting is false.
public abstract boolean enableAllMethods
Object class) as actions of the embedded DSL. If set to false,
only those methods annotated with a DSLAction annotation and have
DSLAction#disable() set to false will be available as
DSL actions.
The default setting is true.
public abstract boolean includeInherited
false,
only those methods directly declared in this class will be regarded as potential
DSL actions.
The default setting is true.
public abstract boolean forwardAllConstructors
false, only those constructors annotated with DSLConstructor
will be forwarded. If set to true, forwarding of a single constructor can be
effectively prevented by annotating it with DSLConstructor and setting
DSLConstructor.value() to Visibility.PRIVATE.
The default setting is true.
public abstract com.github.misberner.apcommons.util.Visibility delegateConstructorVisibility
Visibility.PRIVATE. Note that the visibility of the generated
delegate constructor will never be higher than that of the DSL implementation.
The default setting is Visibility.PUBLIC.
public abstract com.github.misberner.apcommons.util.Visibility forwardConstructorVisibility
Copyright © 2013-2014. All Rights Reserved.