Headline

Language construct for metadata in Language:Java programs

Illustration

In Language:Java (and many other programming languages likewise), metadata can be associated with program constructs by means of designated language support. Such metadata goes by the name of annotations in Java. For instance, when a method should be tagged to be a "test method" for Technology:JUnit, then this would look as follows:

import org.junit.Test;
import static org.junit.Assert.*;

public class Tests {
    @Test
    public void test42() {
		assertEquals(42.0, 42.0, 0.0);
	}
}

Thus, "@Test" is the annotation which tells JUnit to execute the "test42" method along test execution. That is, "@Test" is metadata about the method "test42". JUnit is essentially a metaprogram that looks for such metadata.

Metadata


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.