ammachado opened a new pull request, #23544:
URL: https://github.com/apache/camel/pull/23544
# Description
Continues the CAMEL-22894 series, which extracts inline Simple language
function dispatch from the monolithic `SimpleFunctionExpression` into dedicated
`SimpleLanguageFunctionFactory` implementations.
This PR covers six new factory classes:
| Factory | Functions handled |
|---|---|
| `SystemFunctionFactory` | `${sys.name}`, `${sysenv.name}`,
`${sysenv:name}`, `${env.name}`, `${env:name}` |
| `PropertiesFunctionFactory` | `${propertiesExist:key}`,
`${properties:key}`, `${properties:key:default}`, `${ref:name}` |
| `TypeFunctionFactory` | `${type:fqn}`, `${type:fqn.FIELD}` |
| `DateFunctionFactory` | `${date:command}`, `${date:command:pattern}`,
`${date-with-timezone:command:timezone:pattern}` (including `date:millis`
code-gen special case) |
| `MessageFunctionFactory` | `${messageAs(type)}`, `${messageAs(type).OGNL}`
|
| `OutputFunctionFactory` | `${pretty(exp)}`, `${toJson(exp)}`,
`${toPrettyJson(exp)}` |
All factories follow the established pattern: `createFunction()` for runtime
evaluation, `createCode()` (deprecated, csimple only) for code generation where
applicable. `MessageFunctionFactory` and `OutputFunctionFactory` omit
`createCode()` since csimple never supported those functions.
Also removes the two `@Deprecated(forRemoval = true)` methods `tryCreate()`
and `tryCreateCode()` from `SimpleFunctionDispatcher`, which were confirmed
unused.
`SimpleFunctionExpression` shrinks by ~160 lines after this PR.
# Target
- [x] I checked that the commit is targeting the correct branch (Camel 4
uses the `main` branch)
# Tracking
- [x] If this is a large change, bug fix, or code improvement, I checked
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for
the change (usually before you start working on it).
# Apache Camel coding standards and style
- [x] I checked that each commit in the pull request has a meaningful
subject line and body.
- [x] I have run `mvn clean install -DskipTests` locally from root folder
and I have committed all auto-generated changes.
_Claude Code on behalf of Adriano Machado_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]