Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit a9580e6

Browse files
committed
Prepare for alpha release
* document API (not finished yet) * integration tests * code cleanup, etc..
1 parent f9fa77e commit a9580e6

117 files changed

Lines changed: 6400 additions & 1316 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: java
2+
jdk:
3+
- openjdk8
4+
after_success:
5+
- mvn clean cobertura:cobertura coveralls:cobertura

checkstyle.xml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
5+
6+
<!--
7+
8+
Checkstyle configuration that checks the sun coding conventions from:
9+
10+
- the Java Language Specification at
11+
http://java.sun.com/docs/books/jls/second_edition/html/index.html
12+
13+
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/
14+
15+
- the Javadoc guidelines at
16+
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
17+
18+
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
19+
20+
- some best practices
21+
22+
Checkstyle is very configurable. Be sure to read the documentation at
23+
http://checkstyle.sf.net (or in your downloaded distribution).
24+
25+
Most Checks are configurable, be sure to consult the documentation.
26+
27+
To completely disable a check, just comment it out or delete it from the file.
28+
29+
Finally, it is worth reading the documentation.
30+
31+
-->
32+
33+
<module name="Checker">
34+
<!--
35+
If you set the basedir property below, then all reported file
36+
names will be relative to the specified directory. See
37+
http://checkstyle.sourceforge.net/5.x/config.html#Checker
38+
39+
<property name="basedir" value="${basedir}"/>
40+
-->
41+
42+
<!-- Checks that each Java package has a Javadoc file used for commenting. -->
43+
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage
44+
<module name="JavadocPackage">
45+
<property name="allowLegacy" value="true"/>
46+
</module>
47+
-->
48+
49+
<!-- Checks whether files end with a new line. -->
50+
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
51+
<module name="NewlineAtEndOfFile">
52+
<property name="lineSeparator" value="lf"/>
53+
</module>
54+
55+
<!-- Checks that property files contain the same keys. -->
56+
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
57+
<module name="Translation"/>
58+
59+
<module name="FileLength"/>
60+
61+
<!-- Following interprets the header file as regular expressions. -->
62+
<!-- <module name="RegexpHeader"/> -->
63+
64+
<module name="FileTabCharacter">
65+
<property name="eachLine" value="true"/>
66+
</module>
67+
68+
<module name="RegexpSingleline">
69+
<!-- \s matches whitespace character, $ matches end of line. -->
70+
<property name="format" value="\s+$"/>
71+
<property name="message" value="Line has trailing spaces."/>
72+
</module>
73+
74+
<module name="TreeWalker">
75+
76+
<property name="cacheFile" value="${checkstyle.cache.file}"/>
77+
78+
<!-- Checks for Javadoc comments. -->
79+
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
80+
<module name="JavadocMethod"/>
81+
<module name="JavadocType"/>
82+
<module name="JavadocVariable"/>
83+
<module name="JavadocStyle"/>
84+
85+
86+
<!-- Checks for Naming Conventions. -->
87+
<!-- See http://checkstyle.sf.net/config_naming.html -->
88+
<module name="LocalFinalVariableName"/>
89+
<module name="LocalVariableName"/>
90+
<module name="MemberName"/>
91+
<module name="MethodName"/>
92+
<module name="PackageName"/>
93+
<module name="ParameterName"/>
94+
<!-- <module name="StaticVariableName"/> -->
95+
<module name="TypeName"/>
96+
97+
98+
<!-- Checks for Headers -->
99+
<!-- See http://checkstyle.sf.net/config_header.html -->
100+
<!-- <module name="Header"> -->
101+
<!-- The follow property value demonstrates the ability -->
102+
<!-- to have access to ANT properties. In this case it uses -->
103+
<!-- the ${basedir} property to allow Checkstyle to be run -->
104+
<!-- from any directory within a project. See property -->
105+
<!-- expansion, -->
106+
<!-- http://checkstyle.sf.net/config.html#properties -->
107+
<!-- <property -->
108+
<!-- name="headerFile" -->
109+
<!-- value="${basedir}/java.header"/> -->
110+
<!-- </module> -->
111+
112+
113+
<!-- Checks for imports -->
114+
<!-- See http://checkstyle.sf.net/config_import.html -->
115+
<module name="AvoidStarImport"/>
116+
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
117+
<module name="RedundantImport"/>
118+
<module name="UnusedImports">
119+
<property name="processJavadoc" value="true"/>
120+
</module>
121+
122+
123+
<!-- Checks for Size Violations. -->
124+
<!-- See http://checkstyle.sf.net/config_sizes.html -->
125+
<module name="LineLength">
126+
<property name="ignorePattern" value="^(import).*$"/>
127+
<property name="max" value="100"/>
128+
</module>
129+
<module name="MethodLength"/>
130+
<module name="ParameterNumber">
131+
<property name="max" value="8"/>
132+
</module>
133+
134+
135+
<!-- Checks for whitespace -->
136+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
137+
<module name="EmptyForIteratorPad"/>
138+
<module name="MethodParamPad"/>
139+
<module name="NoWhitespaceAfter"/>
140+
<module name="NoWhitespaceBefore"/>
141+
<module name="OperatorWrap"/>
142+
<module name="ParenPad"/>
143+
<module name="TypecastParenPad"/>
144+
<module name="WhitespaceAfter"/>
145+
<module name="WhitespaceAround"/>
146+
147+
148+
<!-- Modifier Checks -->
149+
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
150+
<module name="ModifierOrder"/>
151+
<module name="RedundantModifier"/>
152+
153+
154+
<!-- Checks for blocks. You know, those {}'s -->
155+
<!-- See http://checkstyle.sf.net/config_blocks.html -->
156+
<module name="AvoidNestedBlocks"/>
157+
<module name="EmptyBlock"/>
158+
<module name="LeftCurly"/>
159+
<module name="NeedBraces"/>
160+
<module name="RightCurly"/>
161+
162+
163+
<!-- Checks for common coding problems -->
164+
<!-- See http://checkstyle.sf.net/config_coding.html -->
165+
<!-- <module name="AvoidInlineConditionals"/> -->
166+
<module name="EmptyStatement"/>
167+
<module name="EqualsHashCode"/>
168+
<!-- <module name="HiddenField"/> -->
169+
<module name="IllegalInstantiation"/>
170+
<module name="InnerAssignment"/>
171+
<!-- <module name="MagicNumber"/> -->
172+
<module name="MissingSwitchDefault"/>
173+
<module name="RedundantThrows"/>
174+
<module name="SimplifyBooleanExpression"/>
175+
<module name="SimplifyBooleanReturn"/>
176+
177+
<!-- Checks for class design -->
178+
<!-- See http://checkstyle.sf.net/config_design.html -->
179+
<!-- <module name="DesignForExtension"/> -->
180+
<module name="FinalClass"/>
181+
<module name="HideUtilityClassConstructor"/>
182+
<module name="InterfaceIsType"/>
183+
<module name="VisibilityModifier">
184+
<property name="packageAllowed" value="true"/>
185+
<property name="protectedAllowed" value="true"/>
186+
<property name="publicMemberPattern" value="handlebars|fn|inverse|params|tagType|hash|context|line|column|evidence|reason|message|filename|helperName"/>
187+
</module>
188+
189+
190+
<!-- Miscellaneous other checks. -->
191+
<!-- See http://checkstyle.sf.net/config_misc.html -->
192+
<module name="ArrayTypeStyle"/>
193+
<module name="FinalParameters"/>
194+
<module name="TodoComment">
195+
<property name="format" value="WARNING"/>
196+
</module>
197+
<module name="UpperEll"/>
198+
199+
</module>
200+
201+
</module>

examples/src/main/java/jooby/Logica.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
*/
204204
package jooby;
205205

206+
206207
public class Logica {
207208

208209
public static void login(final Request request, final Response response) {

examples/src/main/java/jooby/MyApp.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
*/
204204
package jooby;
205205

206-
import jooby.mvc.Viewable;
206+
import jooby.jetty.Jetty;
207207

208208
import com.google.common.collect.ImmutableMap;
209209

@@ -216,13 +216,14 @@ public class MyApp extends Jooby {
216216
use(new Jackson());
217217
use(new Hbs());
218218

219-
get("/api", (req, resp) -> {
219+
assets("/assets/**");
220+
221+
get("/", (req, resp) -> {
220222
ImmutableMap<Object, Object> model = ImmutableMap.builder()
221223
.put("name", "K")
222224
.build();
223225

224-
resp.when("text/html", () -> new Viewable("index", model))
225-
.send(() -> model);
226+
resp.send(new Viewable("index", model));
226227

227228
});
228229

examples/src/main/java/jooby/Resource.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ public Object index(final String id, final String firstName, final String lastNa
3838
return user;
3939
}
4040

41+
@GET
42+
@Path("/cookie")
43+
public Object cookie(@Named("JSESSIONID") final Cookie cookie) {
44+
return cookie;
45+
}
46+
4147
@GET
4248
@Path("/user")
4349
public Object index(final String id) {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
border: 1px solid;
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(function (exports) {
2+
console.log(exports);
3+
})(window);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<html>
22
<head>
33
<title>Hola</title>
4+
<link rel="stylesheet" href="assets/css/style.css">
45
</head>
56
<body>
67
{{this}}
7-
{{userAgent}}
8-
{{JSESSIONID}}
8+
<script type="text/javascript" src="assets/js/file.js"></script>
99
</body>
1010
</html>

jooby-core/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@
5050
<artifactId>asm</artifactId>
5151
</dependency>
5252

53-
<!-- Guice -->
53+
<!-- cglib -->
5454
<dependency>
55-
<groupId>com.google.inject.extensions</groupId>
56-
<artifactId>guice-multibindings</artifactId>
55+
<groupId>cglib</groupId>
56+
<artifactId>cglib-nodep</artifactId>
5757
</dependency>
5858

59+
<!-- Guice -->
5960
<dependency>
6061
<groupId>com.google.inject.extensions</groupId>
61-
<artifactId>guice-servlet</artifactId>
62-
<version>${guice.version}</version>
62+
<artifactId>guice-multibindings</artifactId>
6363
</dependency>
6464

6565
<dependency>

jooby-core/src/main/java/jooby/AfterRoute.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)