`

MVEL2.0模板(Orb Tags)

阅读更多

MVEL 2.0 Orb Tags
Attention

For MVEL 1.2 and 1.3, goto the Templating Guide.

This page contains a list of all orb-tags available out-of-the-box in the MVEL 2.0 templating engine.

@{} Expression Orb

The expression orb is the most rudimentary form of orb-tag. It contains a value expression which will be evaluated to a string, and appended to the output template. For example:

Hello, my name is @{person.name}

@code{} Silent Code Tag

The silent code tag allows you to execute MVEL expression code in your template. It does not return a value and does not affect the formatting of the template in any way.

@code{age = 23; name = 'John Doe'}
@{name} is @{age} years old.

This template will evaluate to: John Doe is 23 years old.

@if{}-@else{} Control Flow Tags

The @if{} and @else{} tags provide full if-then-else functionality in MVEL Templates. For example:

@if{foo != bar}
   Foo not a bar!
@else{bar != cat}
   Bar is not a cat!
@else{}
   Foo may be a Bar or a Cat!
@end{}
Termination of blocks

All blocks in MVEL Templates must be terminated with an @end{} orb, except in cases of an if-then-else structure, where @else{} tags denote the termination of the previous control statement.

@foreach{} Foreach iteration

The foreach tag allows you to iterate either collections or arrays in your template. Note: that the syntax for foreach has changed in MVEL Templates 2.0 to standardize the foreach notation with that of the MVEL language itself.

@foreach{item : products} 
 - @{item.serialNumber}
@end{}

MVEL 2.0 requires you specify an iteration variable. While MVEL 1.2 assumed the name item if you did not specify an alias, this has been dropped due to some complaints about that default action.

Multi-iteration

You can iterate more than one collection in a single foreach loop at one time by comma-separating the iterations:

@foreach{var1 : set1, var2 : set2}
  @{var1}-@{var2}
@end{}

Delimiting

You can automatically add a text delimiter to an iteration by specifying the iterator in @end{} tag.

@foreach{item : people}@{item.name}@end{', '}

This would return something like: John, Mary, Joseph.

@include{} Include Template File

You may include a template file into an MVEL template using this tag.

@include{'header.mv'}

This is a test template.

You may also execute an MVEL expression inside an include tag by adding a semicolon after the template name:

@include{'header.mv'; title='Foo Title'}

@includeNamed{} Include a Named Template

Named templates are templates that have been precompiled and passed to the runtime via a TemplateRegistry, or templates that have been declared within the template itself. You simply include

You may also execute MVEL code in an @includeNamed{} tag, just as with the @include{} tag.

@includeNamed{'fooTemplate'}
@includeNamed{'footerTemplate', showSomething=true}

@declare{} Declare a Template

In addition to including external templates from external files, and passing them in programmatically, you can declare a template from within a template. Which allows you to do things like this:

@declare{'personTemplate'}
 Name: @{name}
 Age:  @{age}
@end{}

@includeNamed{'personTemplate'; name='John Doe'; age=22}

@comment{} Comment tag

The comment tag allows you add an invisible comment to the template. For example:

@comment{
  This is a comment
}
Hello: @{name}!
分享到:
评论

相关推荐

    95_ORB算法描述与匹配.rar_opencv vs _opencv orb_orb_orb算法c_orb算法c++

    ORB(Oriented FAST and Rotated BRIEF)是一种广泛应用于计算机视觉领域的特征检测与描述算子,由David G. Lowe在2011年提出。ORB算法是FAST关键点检测器和BRIEF描述符的结合,它既考虑了关键点的定位,又包含了...

    ORB算法的MATLAB实现

    ORB(Oriented FAST and Rotated BRIEF)算法是一种常用的计算机视觉中的关键点检测与描述符匹配方法,尤其在图像匹配领域有着广泛的应用。它结合了FAST关键点检测器的快速性和BRIEF描述符的简洁性,同时对旋转具有...

    ORB-SLAM3论文.pdf

    ORB-SLAM3论文.pdf ORB-SLAM3是视觉SLAM(Simultaneous Localization and Mapping,同步定位和映射)领域的一个开源库,能够处理视觉、视觉惯性和多图SLAM任务。该系统可以使用单目、立体和RGB-D摄像机,并支持针孔...

    ORB_SLAM3源码

    ORB_SLAM3是一款开源的视觉SLAM(Simultaneous Localization And Mapping)系统,由西班牙巴塞罗那大学的Vladimir Louriero等人开发,并在GitHub上由UZ-SLAMLab维护。视觉SLAM是机器人领域的一个核心问题,旨在通过...

    用ORB SLAM2跑自己的图片序列数据集

    ./images/frame0002.jpg 2.0 ... ``` ORB SLAM2的运行流程大致如下: 1. **初始化**:启动ORB SLAM2时,它会读取rgb.txt文件,并加载第一帧图片进行特征检测和匹配。ORB(Oriented FAST and Rotated BRIEF)特征被...

    orb&sift_SIFT算法_orb_python_

    本主题将深入探讨两种流行的局部特征检测算法:Scale-Invariant Feature Transform(SIFT)和Oriented FAST and Rotated BRIEF(ORB)。这两种方法在Python中通常通过OpenCV库来实现。 SIFT算法由David G. Lowe在...

    ORB算法描述与匹配.zip_ORB特征点匹配_ORB算法描述与匹配_orb

    ORB(Oriented FAST and Rotated BRIEF)算法是一种在计算机视觉领域广泛使用的特征检测和描述算子,尤其在实时应用中表现出色。它的全名由两部分组成:FAST(Features from Accelerated Segment Test)特征检测器和...

    Window下移植成功的ORB_SLAM-master

    ORB_SLAM(ORB-SLAM, Oriented FAST and Rotated BRIEF SLAM)是一种广泛使用的视觉SLAM(Simultaneous Localization And Mapping,即同时定位与建图)框架,由Carlos Nieto、Jesús Montiel和Miguel A. Muñoz在...

    ORB_SLAM3源码(附带详细注释)

    ORB_SLAM3是一款开源的视觉SLAM(Simultaneous Localization And Mapping,同时定位与建图)系统,由西班牙瓦伦西亚大学的Víctor Lamo-Magaz、Toni Salido-Escrivá和Raúl Mur-Artal等人开发。这个系统在前两代的...

    ORB_SLAM3官方标定文档的中文版

    ORB_SLAM3 官方标定文档中文版知识点 ORB_SLAM3 官方标定文档中文版是 ORB_SLAM3 的视觉和惯性标定的官方指南。该文档提供了详细的标定文件格式、坐标系定义、外参和内参的说明。 1. 坐标系定义 ORB_SLAM3 中定义...

    ORB_SLAM2源码工作空间(带位姿发布功能)

    ORB_SLAM2是一款著名的视觉定位系统,由Juan Nieto、Olivier Stasse和Raul Mur-Artal等人开发,广泛应用于无人机、机器人导航、增强现实等领域。它基于特征匹配和光束法平差,实现了单目、双目和RGB-D相机的实时SLAM...

    ORB OpenCV

    ORB(Oriented FAST and Rotated BRIEF)是OpenCV库中的一种特征检测与描述符算法,主要用于图像识别和匹配。它结合了FAST关键点检测器和BRIEF描述符的优点,具有计算效率高、鲁棒性强等特点,尤其适用于实时应用。 ...

    OrbFeatureMatches_orb特征匹配_orb_

    标题中的"OrbFeatureMatches_orb特征匹配_orb_"指的是在计算机视觉领域中,使用ORB(Oriented FAST and Rotated BRIEF)特征进行图像匹配的过程。ORB是一种高效的特征检测与描述算子,它结合了FAST关键点检测器和...

    ORB SLAM.zip

    ORB SLAM,全称为“ORB Scale-Invariant Feature Transform Simultaneous Localization And Mapping”,是一种广泛使用的视觉SLAM(Simultaneous Localization And Mapping)算法。SLAM是机器人和自动驾驶领域中的...

    ORB算法实现匹配

    ORB(Oriented FAST and Rotated BRIEF)算法是一种常用的计算机视觉中的特征检测与描述方法,它结合了FAST关键点检测器和BRIEF描述符的优点,具有计算速度快、鲁棒性强的特点,广泛应用于图像匹配、物体识别、SLAM...

    ORB_SLAM论文原文

    ### ORB-SLAM: 一种多功能且准确的单目SLAM系统 #### 摘要及背景介绍 本文介绍了ORB-SLAM系统,这是一种基于特征的单目SLAM(Simultaneous Localization and Mapping,同时定位与建图)系统,能够在实时环境下运行...

    ORB-SLAM3 安装(详细)

    `sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libopenexr-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev` 安装 OpenCV 的依赖项: `...

    《ORB-SLAM2源码解析》学习手册v1.0-对外.pdf.pdf

    ORB-SLAM2源码解析学习手册v1.0-对外.pdf.pdf ORB-SLAM2是基于视觉的SLAM(Simultaneous Localization and Mapping)算法的开源实现,能够实时生成高精度的地图和定位信息。在计算机视觉领域中,SLAM技术被广泛应用...

    利用ORB匹配实现场景中的物体模板检测

    本篇文章将深入探讨如何利用ORB匹配实现场景中的物体模板检测,以及与OpenCV库的结合使用。 首先,我们需要理解ORB的基本概念。ORB是FAST关键点检测器和BRIEF描述符的结合,其中FAST(Features from Accelerated ...

Global site tag (gtag.js) - Google Analytics