Class EvaluatedExpressionCompilationUtils
java.lang.Object
io.micronaut.expressions.parser.ast.util.EvaluatedExpressionCompilationUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassElementgetRequiredClassElement(io.micronaut.sourcegen.model.TypeDef type, VisitorContext visitorContext) ProvidesClassElementfor passed type or throws exception if class element can not be provided.static booleanisAssignable(ClassElement parameter, ClassElement argument) Checks whether the argument class element is assignable to the parameter class element.
-
Constructor Details
-
EvaluatedExpressionCompilationUtils
public EvaluatedExpressionCompilationUtils()
-
-
Method Details
-
isAssignable
Checks whether the argument class element is assignable to the parameter class element. This method also accepts primitive and wrapper elements and determines whether argument can be assigned to parameter after boxing or unboxing. In case when parameter or argument is an array, array dimensions are also checked.- Parameters:
parameter- checked parameterargument- checked argument- Returns:
- whether argument is assignable to parameter
-
getRequiredClassElement
public static ClassElement getRequiredClassElement(io.micronaut.sourcegen.model.TypeDef type, VisitorContext visitorContext) ProvidesClassElementfor passed type or throws exception if class element can not be provided.- Parameters:
type- Type element for whichClassElementneeds to be obtained. This type can also represent a primitive type. In this case it will be boxedvisitorContext- visitor context- Returns:
- resolved class element
- Throws:
ExpressionCompilationException- if class element can not be obtained
-