[
https://issues.apache.org/jira/browse/GROOVY-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-2521:
--------------------------------
Fix Version/s: (was: 4.x)
> keyword 'use' like 'import (static)' to use categories in a complete
> compilation unit
> -------------------------------------------------------------------------------------
>
> Key: GROOVY-2521
> URL: https://issues.apache.org/jira/browse/GROOVY-2521
> Project: Groovy
> Issue Type: New Feature
> Reporter: Jörg Gottschling
> Priority: Major
>
> I'd like to have a keyword 'use' which can be used at the beginning of a
> file, like a static import, but as category. So:
> The first example from http://groovy.codehaus.org/Groovy+Categories :
> import groovy.xml.*
> def html = /* ... */
> use (groovy.xml.dom.DOMCategory) {
> assert html.head.title.text() == 'Test'
> // ...
> }
> Would then become:
> import groovy.xml.*
> use groovy.xml.dom.DOMCategory
> def html = /* ... */
> assert html.head.title.text() == 'Test'
> assert html.body.p.text() == 'This is a test.'
> // ...
> I think this is extremely usefull when using a category in more then one
> method.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)