Made a Javadoc review.
This commit is contained in:
parent
33252b83ab
commit
dd682a6b0a
12 changed files with 72 additions and 37 deletions
|
@ -36,8 +36,9 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||
* The Class KissDispatcher.
|
||||
*
|
||||
* 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
|
||||
{
|
||||
|
|
|
@ -31,13 +31,13 @@ import jakarta.servlet.http.HttpServlet;
|
|||
*/
|
||||
public class KissDispatcherFactory
|
||||
{
|
||||
static Logger logger = LoggerFactory.getLogger(KissDispatcherFactory.class);
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
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.
|
||||
* ClassPath -> Servlet.
|
||||
|
@ -66,10 +66,11 @@ public class KissDispatcherFactory
|
|||
*
|
||||
* @param config
|
||||
* the config
|
||||
* @param request
|
||||
* the request
|
||||
* @param servletClass
|
||||
* the servlet class
|
||||
* @return the http servlet
|
||||
* @throws ServletException
|
||||
* the servlet exception
|
||||
*/
|
||||
public HttpServlet provideServlet(final ServletConfig config, final Class<HttpServlet> servletClass) throws ServletException
|
||||
{
|
||||
|
|
|
@ -44,14 +44,14 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||
*/
|
||||
public class KissDispatcherUtils
|
||||
{
|
||||
static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
|
||||
|
||||
public enum ContentDispositionType
|
||||
{
|
||||
ATTACHMENT,
|
||||
INLINE
|
||||
}
|
||||
|
||||
static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
|
||||
|
||||
/**
|
||||
* Builds the class name.
|
||||
*
|
||||
|
@ -259,8 +259,8 @@ public class KissDispatcherUtils
|
|||
/**
|
||||
* Checks if is available path.
|
||||
*
|
||||
* @param urlPath
|
||||
* the url path
|
||||
* @param path
|
||||
* the path
|
||||
* @return true, if is available path
|
||||
*/
|
||||
public static boolean isAvailablePath(final String path)
|
||||
|
@ -586,6 +586,10 @@ public class KissDispatcherUtils
|
|||
}
|
||||
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);
|
||||
}
|
||||
finally
|
||||
|
|
|
@ -28,7 +28,6 @@ import java.util.List;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import fr.devinsy.kiss4web.Kiss4webException;
|
||||
import jakarta.servlet.http.HttpServlet;
|
||||
|
||||
/**
|
||||
|
@ -79,7 +78,6 @@ public class AnnotationUtils
|
|||
* Gets the annotation hooks.
|
||||
*
|
||||
* @return the annotation hooks
|
||||
* @throws Kiss4webException
|
||||
*/
|
||||
public static AnnotationHooks getAnnotationHooks()
|
||||
{
|
||||
|
|
|
@ -23,9 +23,17 @@ import java.lang.annotation.Retention;
|
|||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* The Interface KissServlet.
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface KissServlet
|
||||
{
|
||||
/**
|
||||
* Value of the pathInfo regex to map on the annoted class..
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
String value();
|
||||
}
|
||||
|
|
|
@ -27,6 +27,9 @@ import javax.lang.model.element.Element;
|
|||
import javax.lang.model.element.TypeElement;
|
||||
import javax.tools.Diagnostic;
|
||||
|
||||
/**
|
||||
* The Class KissServletProcessor.
|
||||
*/
|
||||
@javax.annotation.processing.SupportedAnnotationTypes("fr.devinsy.kiss4web.dispatcher.annotation.KissServlet")
|
||||
@javax.annotation.processing.SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_17)
|
||||
public class KissServletProcessor extends AbstractProcessor
|
||||
|
|
|
@ -37,10 +37,8 @@ public class DirectHook extends HookCore
|
|||
/**
|
||||
* Instantiates a new direct hook.
|
||||
*
|
||||
* @param regex
|
||||
* the regex
|
||||
* @param targetClassName
|
||||
* the target class path
|
||||
* the target class name
|
||||
*/
|
||||
public DirectHook(final String targetClassName)
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* The Class StaticPageServlet.
|
||||
* The Class DirectServlet.
|
||||
*/
|
||||
public class DirectServlet extends HttpServlet
|
||||
{
|
||||
|
@ -42,7 +42,10 @@ public class DirectServlet extends HttpServlet
|
|||
private String path;
|
||||
|
||||
/**
|
||||
* Instantiates a new static page servlet.
|
||||
* Instantiates a new direct servlet.
|
||||
*
|
||||
* @param path
|
||||
* the path
|
||||
*/
|
||||
public DirectServlet(final String path)
|
||||
{
|
||||
|
|
|
@ -46,6 +46,9 @@ public class ErrorServlet extends HttpServlet
|
|||
|
||||
/**
|
||||
* Instantiates a new error servlet.
|
||||
*
|
||||
* @param message
|
||||
* the message
|
||||
*/
|
||||
public ErrorServlet(final String message)
|
||||
{
|
||||
|
@ -54,6 +57,11 @@ public class ErrorServlet extends HttpServlet
|
|||
|
||||
/**
|
||||
* Instantiates a new error servlet.
|
||||
*
|
||||
* @param message
|
||||
* the message
|
||||
* @param exception
|
||||
* the exception
|
||||
*/
|
||||
public ErrorServlet(final String message, final Exception exception)
|
||||
{
|
||||
|
|
|
@ -123,8 +123,8 @@ public class HookRegister
|
|||
/**
|
||||
* Register.
|
||||
*
|
||||
* @param hook
|
||||
* the hook
|
||||
* @param hooks
|
||||
* the hooks
|
||||
* @return the hook register
|
||||
*/
|
||||
public HookRegister register(final Collection<? extends Hook> hooks)
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.io.File;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import fr.devinsy.kiss4web.Kiss4webException;
|
||||
import jakarta.servlet.ServletConfig;
|
||||
import jakarta.servlet.ServletContext;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
@ -45,8 +44,6 @@ public class WebContentHook extends HookCore
|
|||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @throws Kiss4webException
|
||||
*/
|
||||
@Override
|
||||
public String getServletClassName(final ServletConfig servletConfig, final HttpServletRequest request)
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
@ -22,22 +22,26 @@ import java.util.Iterator;
|
|||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Class Groups.
|
||||
*/
|
||||
public class Groups extends Vector<Group>
|
||||
{
|
||||
private static final long serialVersionUID = 6238581648850758903L;
|
||||
|
||||
/**
|
||||
*
|
||||
* Instantiates a new groups.
|
||||
*/
|
||||
public Groups()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Contains.
|
||||
*
|
||||
* @param name
|
||||
* the name
|
||||
* @return true, if successful
|
||||
*/
|
||||
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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -150,7 +166,7 @@ public class Groups extends Vector<Group>
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
|
@ -173,5 +189,3 @@ public class Groups extends Vector<Group>
|
|||
return (result);
|
||||
}
|
||||
}
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in a new issue