Package org.faktorips.fl
Interface IdentifierResolver<T extends org.faktorips.codegen.CodeFragment>
- Type Parameters:
T- aCodeFragmentimplementation for a specific target language
- All Known Implementing Classes:
DefaultIdentifierResolver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface IdentifierResolver<T extends org.faktorips.codegen.CodeFragment>
Resolves identifiers used in an expression.
Example:
In the above example2 * a + 3
a is an identifier. The compiler needs to know
a's Datatype and generate appropriate source code that
returns the value of a at runtime. The compiler delegates this task to an
identifier resolver.-
Method Summary
Modifier and TypeMethodDescriptioncompile(String identifier, ExprCompiler<T> exprCompiler, Locale locale) Returns the compilation result for the indicated identifier.
-
Method Details
-
compile
Returns the compilation result for the indicated identifier.If the given string is a valid identifier the compilation result must contain the
source codethat can be inserted in the expression's code along with the identifier'sDatatype.If the string is not a valid identifier the returned compilation result must contain an error message with the code
UNDEFINED_IDENTIFIER.- Parameters:
identifier- The identifier to resolve.locale- The locale used for locale dependent messages.exprCompiler- specializedExprCompilercan down casted and used to ask for properties or services that are necessary to be able to resolve an identifier properly
-