Package org.eclipse.xtext.xbase.lib
Annotation Type Inline
-
@Beta @Retention(RUNTIME) @Target(METHOD) @GwtCompatible public @interface InlineAllows to describe how a certain static function should be inlined by the Xbase compiler.- Since:
- 2.3
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.StringvalueThe inline format string.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanconstantExpressionWhether the compiled Java is a constant expression operator.java.lang.Class<?>[]importedTypes that should be imported to inline the operation.booleanstatementExpressionWhether the inlined expression is a statement expression (see 14.8 - Statement Expressions in Java Language Specification, Third Edition )
-
-
-
Element Detail
-
value
java.lang.String value
The inline format string. Placeholders like
$1, $2etc can be used where the1..nparameters of the inlined method are used for$1to$nand theimported()types are used for subsequent indices. The next index$ncan be used to insert all type parameters of the original declaration. And finally the last indices refer to the upper bound substitute of the type parameters individually.So the order is arguments, imports, all type parameters at once incl. brackets and upper bounds of the individual type parameters without brackets
For the following signature
@Inline(value=".." imported = BigDecimal.class) public void <T1, T2> myMethod(String p1, String p2)-
$1refers top1 -
$2refers top2 -
$3refers toBigDecimal -
$4refers to<T1, T2> -
$5refers to the upper bound ofT1 -
$6refers to the upper bound ofT2
-
-
-
-
statementExpression
boolean statementExpression
Whether the inlined expression is a statement expression (see 14.8 - Statement Expressions in Java Language Specification, Third Edition )- Default:
- false
-
-
-
constantExpression
boolean constantExpression
Whether the compiled Java is a constant expression operator. (see 15.28. Constant Expressions in Java Language Specification, Third Edition- Since:
- 2.5
- Default:
- false
-
-