Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p>Let say we have a server that manage a library in which you can add a book, find a book and get all the books. The server code will probably look like this:</p> <table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="title=BookService.groovy" data-macro-default-parameter="java" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6amF2YXx0aXRsZT1Cb29rU2VydmljZS5ncm9vdnl9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> class BookService { private List allBooks = new ArrayList() Book findBook(String isbn) { for (book in allBooks) { if (book.isbn == isbn) return book } return null } void addBook(Book book) { allBooks.add(book) } Book[] getBooks() { return (Book[])allBooks.toArray(new Book[allBooks.size()]) } } </pre></td></tr></table> <p>with the class Book being something like that.</p> <table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="title=Book.groovy" data-macro-default-parameter="java" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6amF2YXx0aXRsZT1Cb29rLmdyb292eX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> class Book { String author String title String isbn } </pre></td></tr></table> <p><br class="atl-forced-newline" /> To ignore the <code>metaClass</code> property a custom type mapping must be defined (for details refer to <a href="http://xfire.codehaus.org/Aegis+Binding">Aegis Binding</a>).</p> <table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="title=Book.aegis.xml" data-macro-default-parameter="xml" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6eG1sfHRpdGxlPUJvb2suYWVnaXMueG1sfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> <?xml version="1.0" encoding="UTF-8"?> <mappings xmlns:sample="http://DefaultNamespace"> <mapping name="sample:Book"> <property name="metaClass" ignore="true"/> </mapping> </mappings> </pre></td></tr></table> <p><br class="atl-forced-newline" /> However, if you compile custom data types from Java the bytecode won't contain a <code>metaClass</code> property and, hence, there is no need to define a custom mapping.</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced