Skip to content

Commit

Permalink
Add package-info.javas (#97)
Browse files Browse the repository at this point in the history
* javadocs

* Update Jex.java

* Update JdkJexServer.java

* package info
  • Loading branch information
SentryMan authored Nov 27, 2024
1 parent d6f0542 commit 8ddb68d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 18 deletions.
23 changes: 8 additions & 15 deletions avaje-jex/src/main/java/io/avaje/jex/Routing.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

import io.avaje.jex.security.Role;

/** Routing abstraction. */
public sealed interface Routing permits DefaultRouting {

/** Add the routes provided by the Routing HttpService. */
Routing add(Routing.HttpService routes);
/** Add the routes provided by the given HttpService. */
Routing add(Routing.HttpService service);

/** Add all the routes provided by the Routing Services. */
Routing addAll(Collection<Routing.HttpService> routes);
Expand Down Expand Up @@ -47,12 +48,12 @@ public sealed interface Routing permits DefaultRouting {
Routing withRoles(Role... permittedRoles);

/**
* Registers an error handler that handles the given type of exceptions.
* This will replace an existing error handler for the same exception class.
* Registers an error handler that handles the given type of exceptions. This will replace an
* existing error handler for the same exception class.
*
* @param exceptionClass the type of exception to handle by this handler
* @param handler the error handler
* @param <T> exception type
* @param handler the error handler
* @param <T> exception type
* @return updated routing
*/
<T extends Exception> Routing error(Class<T> exceptionClass, ExceptionHandler<T> handler);
Expand Down Expand Up @@ -87,7 +88,7 @@ public sealed interface Routing permits DefaultRouting {
/** Add a filter for all requests. */
Routing filter(HttpFilter handler);

/** Add a preprocessing filter for all requests. */
/** Add a pre-processing filter for all requests. */
default Routing before(Consumer<Context> handler) {

return filter(
Expand Down Expand Up @@ -154,21 +155,13 @@ interface Entry {

/** The type of route entry. */
enum Type {
/** Http GET. */
GET,
/** Http POST. */
POST,
/** HTTP PUT. */
PUT,
/** HTTP PATCH. */
PATCH,
/** HTTP DELETE. */
DELETE,
/** HTTP HEAD. */
HEAD,
/** HTTP TRACE. */
TRACE,
/** HTTP OPTIONS. */
OPTIONS;
}
}
4 changes: 2 additions & 2 deletions avaje-jex/src/main/java/io/avaje/jex/StaticContentConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static StaticContentConfig create() {
/**
* Sets the file to serve, or the folder your files are located in. (default: "/public/")
*
* @param root the root directory
* @param resource the root directory
* @return the updated configuration
*/
StaticContentConfig resource(String resource);
Expand Down Expand Up @@ -91,7 +91,7 @@ static StaticContentConfig create() {
*/
StaticContentConfig location(ResourceLocation location);

/** the resource location */
/** Resource location */
public enum ResourceLocation {
CLASS_PATH,
FILE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** Optional JsonServices */
package io.avaje.jex.core.json;
2 changes: 2 additions & 0 deletions avaje-jex/src/main/java/io/avaje/jex/http/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** Http Exceptions */
package io.avaje.jex.http;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** Security Classes */
package io.avaje.jex.security;
6 changes: 5 additions & 1 deletion avaje-jex/src/main/java/io/avaje/jex/spi/package-info.java
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/** SPI extension interfaces */
/**
* SPI extension interfaces
*
* @see {@link io.avaje.jex.spi.JexExtension}
*/
package io.avaje.jex.spi;
18 changes: 18 additions & 0 deletions avaje-jex/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
import io.avaje.jex.spi.JexExtension;

/**
* Defines the Jex HTTP server API, for running a minimal HTTP server.
*
* <pre>{@code
* final Jex.Server app = Jex.create()
* .routing(routing -> routing
* .get("/", ctx -> ctx.text("hello world"))
* .get("/one", ctx -> ctx.text("one"))
* .port(8080)
* .start();
*
* app.shutdown();
*
* }</pre>
*
* @uses JexExtension
*
*/
module io.avaje.jex {

exports io.avaje.jex;
Expand Down

0 comments on commit 8ddb68d

Please sign in to comment.