Made a Javadoc review.

This commit is contained in:
Christian P. MOMON 2024-08-18 22:36:23 +02:00
parent 33252b83ab
commit dd682a6b0a
12 changed files with 72 additions and 37 deletions

View file

@ -36,8 +36,9 @@ import jakarta.servlet.http.HttpServletRequest;
* The Class KissDispatcher. * The Class KissDispatcher.
* *
* According that URL is under UTF-8 format. Set Tomcat connector if needs * According that URL is under UTF-8 format. Set Tomcat connector if needs
* (<connector URIEncoding="UTF-8" />). * <pre>
* * <connector URIEncoding="UTF-8" />.
* </pre>
*/ */
public class KissDispatcher public class KissDispatcher
{ {

View file

@ -31,13 +31,13 @@ import jakarta.servlet.http.HttpServlet;
*/ */
public class KissDispatcherFactory public class KissDispatcherFactory
{ {
static Logger logger = LoggerFactory.getLogger(KissDispatcherFactory.class);
private static class SingletonHolder private static class SingletonHolder
{ {
private static final KissDispatcherFactory instance = new KissDispatcherFactory(); private static final KissDispatcherFactory instance = new KissDispatcherFactory();
} }
static Logger logger = LoggerFactory.getLogger(KissDispatcherFactory.class);
/* /*
* Need to avoid servlet duplication when more than pathinfo is matching a servlet. * Need to avoid servlet duplication when more than pathinfo is matching a servlet.
* ClassPath -> Servlet. * ClassPath -> Servlet.
@ -66,10 +66,11 @@ public class KissDispatcherFactory
* *
* @param config * @param config
* the config * the config
* @param request * @param servletClass
* the request * the servlet class
* @return the http servlet * @return the http servlet
* @throws ServletException * @throws ServletException
* the servlet exception
*/ */
public HttpServlet provideServlet(final ServletConfig config, final Class<HttpServlet> servletClass) throws ServletException public HttpServlet provideServlet(final ServletConfig config, final Class<HttpServlet> servletClass) throws ServletException
{ {

View file

@ -44,14 +44,14 @@ import jakarta.servlet.http.HttpServletResponse;
*/ */
public class KissDispatcherUtils public class KissDispatcherUtils
{ {
static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
public enum ContentDispositionType public enum ContentDispositionType
{ {
ATTACHMENT, ATTACHMENT,
INLINE INLINE
} }
static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
/** /**
* Builds the class name. * Builds the class name.
* *
@ -259,8 +259,8 @@ public class KissDispatcherUtils
/** /**
* Checks if is available path. * Checks if is available path.
* *
* @param urlPath * @param path
* the url path * the path
* @return true, if is available path * @return true, if is available path
*/ */
public static boolean isAvailablePath(final String path) public static boolean isAvailablePath(final String path)
@ -586,6 +586,10 @@ public class KissDispatcherUtils
} }
catch (IOException exception) catch (IOException exception)
{ {
System.out.println("/!\\/!\\/!\\/!\\/!\\/!\\/!\\/!\\/!\\/!\\/!\\/!\\/!\\/!\\/!\\");
exception.printStackTrace();
// TODO As sendError cannot be send because partial content has
// been send, we have to replace this with a better way.
response.sendError(HttpServletResponse.SC_PARTIAL_CONTENT); response.sendError(HttpServletResponse.SC_PARTIAL_CONTENT);
} }
finally finally

View file

@ -28,7 +28,6 @@ import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.Kiss4webException;
import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServlet;
/** /**
@ -79,7 +78,6 @@ public class AnnotationUtils
* Gets the annotation hooks. * Gets the annotation hooks.
* *
* @return the annotation hooks * @return the annotation hooks
* @throws Kiss4webException
*/ */
public static AnnotationHooks getAnnotationHooks() public static AnnotationHooks getAnnotationHooks()
{ {

View file

@ -23,9 +23,17 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/**
* The Interface KissServlet.
*/
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface KissServlet public @interface KissServlet
{ {
/**
* Value of the pathInfo regex to map on the annoted class..
*
* @return the string
*/
String value(); String value();
} }

View file

@ -27,6 +27,9 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic; import javax.tools.Diagnostic;
/**
* The Class KissServletProcessor.
*/
@javax.annotation.processing.SupportedAnnotationTypes("fr.devinsy.kiss4web.dispatcher.annotation.KissServlet") @javax.annotation.processing.SupportedAnnotationTypes("fr.devinsy.kiss4web.dispatcher.annotation.KissServlet")
@javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_17) @javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_17)
public class KissServletProcessor extends AbstractProcessor public class KissServletProcessor extends AbstractProcessor

View file

@ -37,10 +37,8 @@ public class DirectHook extends HookCore
/** /**
* Instantiates a new direct hook. * Instantiates a new direct hook.
* *
* @param regex
* the regex
* @param targetClassName * @param targetClassName
* the target class path * the target class name
*/ */
public DirectHook(final String targetClassName) public DirectHook(final String targetClassName)
{ {

View file

@ -32,7 +32,7 @@ import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
/** /**
* The Class StaticPageServlet. * The Class DirectServlet.
*/ */
public class DirectServlet extends HttpServlet public class DirectServlet extends HttpServlet
{ {
@ -42,7 +42,10 @@ public class DirectServlet extends HttpServlet
private String path; private String path;
/** /**
* Instantiates a new static page servlet. * Instantiates a new direct servlet.
*
* @param path
* the path
*/ */
public DirectServlet(final String path) public DirectServlet(final String path)
{ {

View file

@ -46,6 +46,9 @@ public class ErrorServlet extends HttpServlet
/** /**
* Instantiates a new error servlet. * Instantiates a new error servlet.
*
* @param message
* the message
*/ */
public ErrorServlet(final String message) public ErrorServlet(final String message)
{ {
@ -54,6 +57,11 @@ public class ErrorServlet extends HttpServlet
/** /**
* Instantiates a new error servlet. * Instantiates a new error servlet.
*
* @param message
* the message
* @param exception
* the exception
*/ */
public ErrorServlet(final String message, final Exception exception) public ErrorServlet(final String message, final Exception exception)
{ {

View file

@ -123,8 +123,8 @@ public class HookRegister
/** /**
* Register. * Register.
* *
* @param hook * @param hooks
* the hook * the hooks
* @return the hook register * @return the hook register
*/ */
public HookRegister register(final Collection<? extends Hook> hooks) public HookRegister register(final Collection<? extends Hook> hooks)

View file

@ -23,7 +23,6 @@ import java.io.File;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fr.devinsy.kiss4web.Kiss4webException;
import jakarta.servlet.ServletConfig; import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletContext; import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
@ -45,8 +44,6 @@ public class WebContentHook extends HookCore
/** /**
* {@inheritDoc} * {@inheritDoc}
*
* @throws Kiss4webException
*/ */
@Override @Override
public String getServletClassName(final ServletConfig servletConfig, final HttpServletRequest request) public String getServletClassName(final ServletConfig servletConfig, final HttpServletRequest request)

View file

@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2006-2010, 2013-2014 Christian Pierre MOMON * Copyright (C) 2006-2010, 2013-2014, 2024 Christian Pierre MOMON
* *
* This file is part of Kiss4web. * This file is part of Kiss4web.
* *
@ -22,22 +22,26 @@ import java.util.Iterator;
import java.util.Vector; import java.util.Vector;
/** /**
* * The Class Groups.
*/ */
public class Groups extends Vector<Group> public class Groups extends Vector<Group>
{ {
private static final long serialVersionUID = 6238581648850758903L; private static final long serialVersionUID = 6238581648850758903L;
/** /**
* * Instantiates a new groups.
*/ */
public Groups() public Groups()
{ {
super(); super();
} }
/* /**
* Contains.
* *
* @param name
* the name
* @return true, if successful
*/ */
public boolean contains(final String name) public boolean contains(final String name)
{ {
@ -57,7 +61,11 @@ public class Groups extends Vector<Group>
} }
/** /**
* Gets the.
* *
* @param name
* the name
* @return the group
*/ */
public Group get(final String name) public Group get(final String name)
{ {
@ -96,7 +104,11 @@ public class Groups extends Vector<Group>
} }
/** /**
* Gets the login groups.
* *
* @param login
* the login
* @return the login groups
*/ */
public Vector<String> getLoginGroups(final String login) public Vector<String> getLoginGroups(final String login)
{ {
@ -120,7 +132,11 @@ public class Groups extends Vector<Group>
} }
/** /**
* Gets the login groups string.
* *
* @param login
* the login
* @return the login groups string
*/ */
public String getLoginGroupsString(final String login) public String getLoginGroupsString(final String login)
{ {
@ -150,7 +166,7 @@ public class Groups extends Vector<Group>
} }
/** /**
* * {@inheritDoc}
*/ */
@Override @Override
public String toString() public String toString()
@ -173,5 +189,3 @@ public class Groups extends Vector<Group>
return (result); return (result);
} }
} }
// ////////////////////////////////////////////////////////////////////////