OGNL (Object Graph Navigation Library) Support
Support for OGNL-expressions with many language specific features is available since IDEA 11.
In 12.1+, Parser and PSI have been rewritten completely using GrammarKit.
Symbol |
Status |
---|---|
fully supported |
|
partly supported |
|
not done yet |
|
future? |
Integration with Struts 2
The goal is to support OGNL-expressions everywhere in Struts 2 applications in the same way as done for EL-expressions in JSPs.
OGNL language is available automatically at the following places:
JSP(X)
Struts UI, JQuery
- all attributes containing "%{" (multiple occurences possible)
- all attributes with list expression "{ el1, el2, ..}"
- <s:iterator> "value" (without any prefix)
Freemarker
Struts UI, JQuery
- all attributes containing "%{" (multiple occurences possible)
- all attributes with list expression "{ el1, el2, ..}"
Velocity
validation.xml
- Validator "fieldexpression" -> "expression"
Editor highlighting
Syntax highlighting
Basic syntax highlighting (identifiers, numbers, string literals, keywords, ..)
Escape sequences in strings
Highlight valid/invalid escape sequences
Semantic highlighting
Highlight missing closing brackets, parentheses, expressions, ...
Highlight matching parentheses, brackets and braces
Spellchecker
Strings and identifiers are checked for spelling errors using IDEA's integrated functionality.
Color settings page
Settings->Editor->Colors & Fonts->OGNL
Customize the appearance (color, style) to your needs:
Completion
Auto-complete closing quote/tick
Auto-complete closing '}'
Will be inserted automatically after typing "%{" and "{".
Keywords
Context-sensitive variants.
Identifiers
Editing
CTRL+W support
Expand/shrink selected part of expression semantically by repeatingly pressing CTRL-(Shift)-W:
Reformat
Basic whitespace-formatting (before/after operators, parentheses, brackets, ...) using Java-settings.
To reformat, use intention "Edit OGNL fragment..." and run "Code->Reformat Code" from there.
Live templates
Create your own OGNL-specific live templates (Context "OGNL") or use one of the predefined templates (see Settings->Live Templates).
NOTE Expanding live templates in injected context works with CTRL+J
Complete Current Statement
Complete expression syntactically, e.g. adding missing closing ")", "}"
Surround With
Provide specific "Surround with.." functionality.
Navigation
Go To Declaration
for identifiers
Go To Code references
Navigate to Class/Method references.
Documentation
QuickDoc
Provide quick documentation on hovering over elements (type, name).