Top Description Methods
org.eclipse.xtext.xbase.lib

public @Interface Inline

extends Annotation
Annotations
@Beta
@Retention:RUNTIME
@Target:METHOD
@GwtCompatible
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target, com.google.common.annotations.Beta, .GwtCompatible

Allows to describe how a certain static function should be inlined by the Xbase compiler.
Author
Sebastian Zarnekow - Initial contribution and API
Since
2.3

Method Summary

Modifier and TypeMethod and Description
public boolean
constantExpression()

Whether the compiled Java is a constant expression operator.

public Class<?>[]
imported()

Types that should be imported to inline the operation.

public boolean
statementExpression()

Whether the inlined expression is a statement expression (see 14.8 - Statement Expressions in Java Language Specification, Third Edition )

public String
value()

The inline format string.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

constantExpressionback to summary
public 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
importedback to summary
public Class<?>[] imported()

Types that should be imported to inline the operation.

statementExpressionback to summary
public boolean statementExpression()

Whether the inlined expression is a statement expression (see 14.8 - Statement Expressions in Java Language Specification, Third Edition )

valueback to summary
public 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

For the following signature
@Inline(value=".." imported = BigDecimal.class) public void <T1, T2> myMethod(String p1, String p2)

  • $1 refers to p1
  • $2 refers to p2
  • $3 refers to BigDecimal
  • $4 refers to <T1, T2>
  • $5 refers to the upper bound of T1
  • $6 refers to the upper bound of T2