Java上的EL技术 [英] Techniques of EL on Java

查看:119
本文介绍了Java上的EL技术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣为POJO的某种EL语言创建自己的服务. 例如,我有一些带有内部POJO对象的对象结构,例如A和B. 因此,我想传递给服务字符串(例如"a.b.name"),而不要获取此属性值.

I interest in creating my own service for some EL language for POJO. For example, I have some object structure with inner POJO objects, A and B for example. So, I want pass to my service string like "a.b.name" and than get this property value.

java反射api或第三部分库中是否有任何实用程序?

Are there any utils in java reflection api or 3rd part libraries?

我可以自己解析此字符串,然后获取字段和方法,但是我认为这是常见的功能.有什么想法吗?

I can parse this string by myself and then get fields and methods, but I think this is common feature. Any ideas?

推荐答案

也许您应该看一下 Groovy .

Spring EL是一种功能齐全的表达语言(您应该能够在不使用框架其余部分的情况下使用它.)

Spring EL is a full featured expression language (you should be able to use it without using the rest of the framework).

Groovy是一种JVM语言,可以轻松集成到Java应用程序中,它强大的语法对于此类任务非常有用.由于它与Java兼容,因此您可以从常规代码访问和修改Java对象.

Groovy is a JVM language that can be easily integrated into java applications and it powerfull syntax can be very useful for such tasks. Since its compatible to Java you can access and modify your Java objects from groovy code.

您还可以查看 Jexl .到目前为止,我还没有使用过它,但是它对您的任务很有用.

You can also look at Jexl. I haven't used this one so far but it looks useful for your task.

这篇关于Java上的EL技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆