org.eclipse.xtext.xbase.lib
Annotation Type Inline


@Beta
@Retention(value=RUNTIME)
@Target(value=METHOD)
@GwtCompatible
public @interface Inline

Allows to describe how a certain static function should be inlined by the Xbase compiler.

Since:
2.3
Author:
Sebastian Zarnekow - Initial contribution and API

Required Element Summary
 String value
          The inline format string.
 
Optional Element Summary
 Class<?>[] imported
          Types that should be imported to inline the operation.
 boolean statementExpression
          whether the inlined expression is a statement expression (see 14.8 - Statement Expressions in Java Language Specification, Third Edition )
 

Element Detail

value

public abstract String value
The inline format string. Placeholders like $1, $2 etc can be used where the 1..n parameters of the inlined method are used for $1 to $n and the imported() types are used for subsequent indices. The next index $n can 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 Example: For the following signatures

imported

public abstract Class<?>[] imported
Types that should be imported to inline the operation.

Default:
{}

statementExpression

public abstract boolean statementExpression
whether the inlined expression is a statement expression (see 14.8 - Statement Expressions in Java Language Specification, Third Edition )

Default:
false


Copyright © 2013. All Rights Reserved.