Skip to content

Commit 01395f2

Browse files
committed
documentation updated for v0.14
1 parent 6e91082 commit 01395f2

14 files changed

Lines changed: 446 additions & 15 deletions

‎_includes/footer.md‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
## Docs
22

33
- [Get started!](/getstarted.html)
4-
- [Immutable objects reference](/immutable.html)
5-
- [JSON marshaling reference](/json.html)
6-
- MongoDB repositories reference (Coming Soon)
7-
8-
## Posts
9-
{% for post in site.posts limit: 10 %}
10-
- [{{ post.title }}]({{ post.url }}){% endfor %}
4+
- [Immutable objects guide](/immutable.html)
5+
- [JSON marshaling guide](/json.html)
6+
- [MongoDB repositories guide](/mongo.html)
7+
- [Using annotation processor in IDE](/apt.html)
118

129
## Get involved
1310

‎_includes/posts.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Posts
2+
{% for post in site.posts limit: 10 %}
3+
- [{{ post.title }}]({{ post.url }}){% endfor %}

‎_includes/story0.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Embrace immutablity to tackle complexity and concurrency challenges. To get benefits of immutability in Java we created annotation processor
1+
Embrace immutability to tackle complexity and concurrency challenges.
2+
To get benefits of immutability in Java we created the annotation processor
23
to easily create simple and consistent value objects. You can think of it as
34
[Guava's Immutable Collections](https://code.google.com/p/guava-libraries/wiki/ImmutableCollectionsExplained)
45
but for regular objects.

‎_includes/storySample2.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public abstract class Item {
1313
```
1414
```java
1515
// Instantiate generated repository
16-
ItemRepository items = ItemRepository.create(
16+
ItemRepository items = new ItemRepository(
1717
RepositorySetup.forUri("mongodb://localhost/test"));
1818

1919
// Insert async

‎apt.md‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: 'Using annotation processor in IDE'
3+
layout: page
4+
---
5+
6+
{% capture v %}0.14{% endcapture %}
7+
{% capture depUri %}http://search.maven.org/#artifactdetails|org.immutables{% endcapture %}
8+
--------
9+
Overview
10+
--------
11+
12+
As of Java 6 annotation processing became part of standard java compiler.
13+
Java 7 or higher is required to run _Immutables_ annotation processor.
14+
_Immutables_ annotation processor runs under any Java build tool that uses `javac` as compiler backend.
15+
(given annotation processing is not disabled in build tool configuration).
16+
_Eclipse JDT compiler_ (ECJ) also supports this annotation processor.
17+
18+
Nowadays major IDE supports annotation processing out of the box while importing projects. That
19+
said there are some quirks that may prevent this functionality to function properly.
20+
21+
Annotation processor that is to be plugged into IDE was built as single jar without external dependencies.
22+
23+
- [org.immutables:generate-tool:{{v}}]({{ depUri }}|generate-tool|{{ v }}|jar)
24+
25+
-------
26+
Eclipse
27+
-------
28+
29+
If you are using Maven, then m2e could configure annotation processing for you. However for this to work
30+
m2e-apt connector should be installed first. Install it from Eclipse marketplace, for example:
31+
32+
<img src="pix/eclipse-marketplace.png">
33+
34+
If it will not work for some reason, you could configure it manually.
35+
36+
Manual configuration tutorial
37+
38+
* [Using Java 6 processors in Eclipse](http://kerebus.com/2011/02/using-java-6-processors-in-eclipse/)
39+
40+
41+
Here's and dialog configuration example to manually configure annotation processor that is already in local
42+
maven repository. One need to enable annotation processing in the project settings, then configure factory path
43+
to point to annotation processor jar, in this example, by extending M2_REPO classpath variable (defined by m2e).
44+
45+
<img src="pix/eclipse-annotation-processing.png">
46+
47+
<img src="pix/eclipse-factory-path.png">
48+
49+
50+
_This section to be expanded_
51+
52+
-------------
53+
IntelliJ IDEA
54+
-------------
55+
IntelliJ IDEA should configure annotation processing automatically
56+
57+
58+
<img src="http://blog.jetbrains.com/idea/files/2009/11/settings.png">
59+
60+
_This section to be expanded_

‎getstarted.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Get started!'
33
layout: page
44
---
55

6-
{% capture v %}0.13{% endcapture %}
6+
{% capture v %}0.14{% endcapture %}
77
{% capture depUri %}http://search.maven.org/#artifactdetails|org.immutables{% endcapture %}
88

99
## Prerequisites
@@ -35,7 +35,7 @@ Snippet of maven dependencies:
3535

3636
_Immutables_ annotation processor runs under any Java build tool that uses `javac` as compiler backend
3737
(given annotation processing is not disabled in build tool configuration).
38-
_Eclipse JDT compiler_ (ECJ) also supports this annotation processor.
38+
_Eclipse JDT compiler_ (ECJ) also supports this annotation processor. See [Using annotation processor in IDE](/apt.html).
3939

4040
## Create immutable object
4141

‎immutable.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ ImmutableDoItYourselfContainer.builder()
246246
.build();
247247
```
248248

249+
<a name="optional"></a>
249250
### Optional attributes
250251

251252
Attributes declared with return type of `com.google.common.base.Optional<T>`

‎index.html‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<h1>Immutables<span class="text-muted">.org</span></h1>
99
{% capture story0 %}{% include story0.md %}{% endcapture %}{{ story0 | markdownify }}
1010
<a href="/getstarted.html" class="btn btn-primary btn-lg">Get started!</a>
11-
<a href="/immutable.html" class="btn btn-default btn-lg">Read reference...</a>
11+
<a href="/immutable.html" class="btn btn-default btn-lg">Read guide...</a>
1212
<a href="https://twitter.com/ImmutablesOrg" class="pull-right">
1313
<i class="fa fa-twitter"></i> News and announcements</a>
1414
</div>
@@ -24,7 +24,7 @@ <h1>Immutables<span class="text-muted">.org</span></h1>
2424
<section class="jumbotron">
2525
<div class="container">
2626
{% capture story1 %}{% include story1.md %}{% endcapture %}{{ story1 | markdownify }}
27-
<a href="/json.html" class="btn btn-default btn-lg">Read reference...</a>
27+
<a href="/json.html" class="btn btn-default btn-lg">Read guide...</a>
2828
</div>
2929
</section>
3030

@@ -38,6 +38,7 @@ <h1>Immutables<span class="text-muted">.org</span></h1>
3838
<section class="jumbotron">
3939
<div class="container">
4040
{% capture story2 %}{% include story2.md %}{% endcapture %}{{ story2 | markdownify }}
41+
<a href="/mongo.html" class="btn btn-default btn-lg">Read guide...</a>
4142
</div>
4243
</section>
4344

‎json.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: 'JSON marshaling reference'
2+
title: 'JSON marshaling guide'
33
layout: page
44
---
55

6-
{% capture v %}0.13{% endcapture %}
6+
{% capture v %}0.14{% endcapture %}
77
{% capture depUri %}http://search.maven.org/#artifactdetails|org.immutables{% endcapture %}
88

99
Overview

0 commit comments

Comments
 (0)