Skip to main content
summaryrefslogtreecommitdiffstats
blob: cc91db085a3e85124c9dd550a3481295ccf8b0af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package org.eclipse.xtend.backend.functions.java;


/**
 * This class serves as an abstraction to convert between the internal, canonical representation
 *  of the instances of a type, and a variation thereof needed by a specific operation (specifically,
 *  a Java implementation).<p>
 *  
 * Examples of this are the List <--> Array conversion, int <--> long, float <--> double or 
 *  CharSequence <--> String.
 */
public final class ParameterConverter {
    private final int _index;
    private final JavaBuiltinConverter _inner;
    
    public ParameterConverter (int index, JavaBuiltinConverter inner) {
        _index = index;
        _inner = inner;
    }
    
    public void convert (Object[] params) {
        params [_index] = _inner.backendToJava (params[_index]);
    }
}

Back to the top