Javadoc review.

This commit is contained in:
Christian P. MOMON 2023-11-28 03:28:49 +01:00
parent 590c99c19b
commit 02a8c54cb6
19 changed files with 303 additions and 142 deletions

View file

@ -0,0 +1,4 @@
eclipse.preferences.version=1
filter_fields=false
project_specific_settings=true
replacements=<?xml version\="1.0" standalone\="yes"?>\n\n<replacements>\n<replacement key\="get" scope\="1" mode\="0">Gets the</replacement>\n<replacement key\="set" scope\="1" mode\="0">Sets the</replacement>\n<replacement key\="add" scope\="1" mode\="0">Adds the</replacement>\n<replacement key\="edit" scope\="1" mode\="0">Edits the</replacement>\n<replacement key\="remove" scope\="1" mode\="0">Removes the</replacement>\n<replacement key\="init" scope\="1" mode\="0">Inits the</replacement>\n<replacement key\="parse" scope\="1" mode\="0">Parses the</replacement>\n<replacement key\="create" scope\="1" mode\="0">Creates the</replacement>\n<replacement key\="build" scope\="1" mode\="0">Builds the</replacement>\n<replacement key\="is" scope\="1" mode\="0">Checks if is</replacement>\n<replacement key\="print" scope\="1" mode\="0">Prints the</replacement>\n<replacement key\="has" scope\="1" mode\="0">Checks for</replacement>\n</replacements>\n\n

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2013-2021 Christian Pierre MOMON
* Copyright (C) 2013-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -74,43 +74,80 @@ public class BuildInformation
}
}
/**
* Author.
*
* @return the string
*/
public String author()
{
return this.author;
}
/**
* Builds the date.
*
* @return the string
*/
public String buildDate()
{
return this.buildDate;
}
/**
* Builds the number.
*
* @return the string
*/
public String buildNumber()
{
return this.buildNumber;
}
/**
* Generator.
*
* @return the string
*/
public String generator()
{
return this.generator;
}
/**
* Major revision.
*
* @return the string
*/
public String majorRevision()
{
return this.majorRevision;
}
/**
* Minor revision.
*
* @return the string
*/
public String minorRevision()
{
return this.minorRevision;
}
/**
* Product name.
*
* @return the string
*/
public String productName()
{
return this.productName;
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString()
@ -125,8 +162,9 @@ public class BuildInformation
}
/**
* Version.
*
* @return
* @return the string
*/
public String version()
{

View file

@ -43,8 +43,6 @@ import fr.devinsy.kiss4web.dispatcher.hooks.XHTMLHook;
*/
public class Kiss4web
{
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Kiss4web.class);
/**
* The Enum Mode.
*/
@ -65,6 +63,8 @@ public class Kiss4web
private static final Kiss4web instance = new Kiss4web();
}
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Kiss4web.class);
private BuildInformation buildInformation;
private Mode mode;
@ -231,7 +231,7 @@ public class Kiss4web
/**
* Sets the mode custom.
*
* @param register
* @param hooks
* the new mode custom
*/
public void setModeCustom(final HookRegister hooks)

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Christian Pierre MOMON <christian.momon@devinsy.fr>
* Copyright (C) 2021-2023 Christian Pierre MOMON <christian.momon@devinsy.fr>
*
* This file is part of Juga, simple key value database.
*
@ -37,6 +37,9 @@ public class Kiss4webLauncher implements javax.servlet.ServletContextListener
{
private static Logger logger = LoggerFactory.getLogger(Kiss4webLauncher.class);
/**
* {@inheritDoc}
*/
@Override
public void contextDestroyed(final ServletContextEvent sce)
{
@ -53,6 +56,9 @@ public class Kiss4webLauncher implements javax.servlet.ServletContextListener
/**
* Inits the logger.
*
* @param webappRoot
* the webapp root
*/
public void initLogger(final String webappRoot)
{

View file

@ -1,35 +1,20 @@
/**
* Copyright 2021 Christian Pierre MOMON, DEVINSY, UMR 7186 LESC.
* Copyright (C) 2021-2023 Christian Pierre MOMON
*
* christian.momon@devinsy.fr
* This file is part of Kiss4web.
*
* This file is part of Kiwa. This software (Kiwa) is a computer program whose
* purpose is to be the Kinsources Web Application, an open interactive platform
* for archiving, sharing, analyzing and comparing kinship data used in
* scientific inquiry.
* Kiss4web is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is governed by the CeCILL license under French law and abiding
* by the rules of distribution of free software. You can use, modify and/ or
* redistribute the software under the terms of the CeCILL license as circulated
* by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
* Kiss4web is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* As a counterpart to the access to the source code and rights to copy, modify
* and redistribute granted by the license, users are provided only with a
* limited warranty and the software's author, the holder of the economic
* rights, and the successive licensors have only limited liability.
*
* In this respect, the user's attention is drawn to the risks associated with
* loading, using, modifying and/or developing or reproducing the software by
* the user in light of its specific status of free software, that may mean that
* it is complicated to manipulate, and that also therefore means that it is
* reserved for developers and experienced professionals having in-depth
* computer knowledge. Users are therefore encouraged to load and test the
* software's suitability as regards their requirements in conditions enabling
* the security of their systems and/or data to be ensured and, more generally,
* to use and operate it in the same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms.
* You should have received a copy of the GNU Lesser General Public License
* along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.kiss4web;
@ -50,22 +35,46 @@ public abstract class Page
private HttpServletRequest request;
private HttpServletResponse response;
/**
* Instantiates a new page.
*
* @param request
* the request
* @param response
* the response
* @throws ServletException
* the servlet exception
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public Page(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException
{
this.request = request;
this.response = response;
}
/**
* Do get.
*/
public void doGet()
{
}
/**
* Do post.
*/
public void doPost()
{
}
/**
* Redirect.
*
* @param urlPath
* the url path
*/
public void redirect(final String urlPath)
{
Redirector.redirect(this.response, urlPath);

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2021 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -28,8 +28,6 @@ import org.slf4j.LoggerFactory;
*/
public class Redirector
{
private static final Logger logger = LoggerFactory.getLogger(Redirector.class);
public enum Type
{
MOVED_PERMANENTLY(HttpServletResponse.SC_MOVED_PERMANENTLY),
@ -42,6 +40,11 @@ public class Redirector
this.statusCode = value;
}
/**
* Status code.
*
* @return the int
*/
public int statusCode()
{
int result;
@ -53,6 +56,8 @@ public class Redirector
}
}
private static final Logger logger = LoggerFactory.getLogger(Redirector.class);
/**
* Redirect.
*

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2021 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2021 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -68,6 +68,14 @@ public class KissDispatcher extends HttpServlet
* will be decoded in the class called later).
* </pre>
*
* @param request
* the request
* @param response
* the response
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws ServletException
* the servlet exception
*/
public void dispatch(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2021 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -36,13 +36,13 @@ import org.slf4j.LoggerFactory;
*/
public class KissDispatcherFactory
{
private static Logger logger = LoggerFactory.getLogger(KissDispatcherFactory.class);
private static class SingletonHolder
{
private static final KissDispatcherFactory instance = new KissDispatcherFactory();
}
private static Logger logger = LoggerFactory.getLogger(KissDispatcherFactory.class);
private KissDispatcherCache cache;
/**
@ -53,6 +53,9 @@ public class KissDispatcherFactory
this.cache = new KissDispatcherCache();
}
/**
* Clear cache.
*/
public void clearCache()
{
this.cache.clear();
@ -147,21 +150,11 @@ public class KissDispatcherFactory
}
/**
* Checks if is availableget path.
* Checks if is available path.
*
* @param servletConfig
* the servlet config
* @param request
* the request
* @param response
* the response
* @param urlPath
* the url path
* @return true, if is availableget path
* @throws IOException
* Signals that an I/O exception has occurred.
* @throws ServletException
* the servlet exception
* @return true, if is available path
*/
public boolean isAvailablePath(final String urlPath)
{

View file

@ -44,14 +44,14 @@ import fr.devinsy.strings.StringList;
*/
public class KissDispatcherUtils
{
private static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
public enum ContentDispositionType
{
ATTACHMENT,
INLINE
}
private static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
/**
* Builds the class name.
*
@ -204,9 +204,9 @@ public class KissDispatcherUtils
/**
* Instanciate servlet.
*
* @param className
* the class name
* @return the http servlet or null if no one found.
* @param classPathname
* the class pathname
* @return the http servlet
*/
public static HttpServlet instanciateServlet(final String classPathname)
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2021 Christian Pierre MOMON
* Copyright (C) 2021-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -76,8 +76,8 @@ public class WebsiteClasspaths extends StringList
/**
* Instanciate servlet.
*
* @param subClasspath
* the sub classpath
* @param className
* the class name
* @return the http servlet
*/
public HttpServlet instanciateServlet(final String className)

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2021 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -33,6 +33,9 @@ public class HookRegister
/**
* Instantiates a new hook register.
*
* @param name
* the name
*/
public HookRegister(final String name)
{
@ -91,6 +94,11 @@ public class HookRegister
return result;
}
/**
* Gets the name.
*
* @return the name
*/
public String getName()
{
return this.name;
@ -116,6 +124,7 @@ public class HookRegister
*
* @param hook
* the hook
* @return the hook register
*/
public HookRegister register(final Hook hook)
{
@ -129,6 +138,12 @@ public class HookRegister
return result;
}
/**
* Register all.
*
* @param register
* the register
*/
public void registerAll(final HookRegister register)
{
this.hooks.addAll(register.getHooks());

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2021 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -75,6 +75,11 @@ public class LongURLRewriter
*
* Note: "-/" is used to indicate the beginning of parameters.
*
* @param path
* the path
* @param parameters
* the parameters
* @return the string
*/
public static String rewrite(final String path, final String... parameters)
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -21,7 +21,7 @@ package fr.devinsy.kiss4web.security;
import java.util.Vector;
/**
*
* The Class Group.
*/
public class Group
{
@ -29,7 +29,7 @@ public class Group
private Vector<String> members;
/**
*
* Instantiates a new group.
*/
public Group()
{
@ -38,7 +38,10 @@ public class Group
}
/**
* Adds the member.
*
* @param login
* the login
*/
public void addMember(final String login)
{
@ -49,7 +52,11 @@ public class Group
}
/**
* Contains.
*
* @param name
* the name
* @return true, if successful
*/
public boolean contains(final String name)
{
@ -62,7 +69,9 @@ public class Group
}
/**
* Members.
*
* @return the vector
*/
public Vector<String> members()
{
@ -75,7 +84,9 @@ public class Group
}
/**
* Name.
*
* @return the string
*/
public String name()
{
@ -88,7 +99,11 @@ public class Group
}
/**
* Sets the name.
*
* @param name
* the name
* @return the group
*/
public Group setName(final String name)
{
@ -99,7 +114,9 @@ public class Group
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString()
@ -112,5 +129,3 @@ public class Group
return (result);
}
}
// ////////////////////////////////////////////////////////////////////////

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -23,12 +23,18 @@ import java.util.Iterator;
import java.util.Properties;
/**
*
* The Class GroupsFileReader.
*/
public class GroupsFileReader
{
/**
* Load.
*
* @param fileName
* the file name
* @return the groups
* @throws Exception
* the exception
*/
public static Groups load(final String fileName) throws Exception
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -21,7 +21,7 @@ package fr.devinsy.kiss4web.security;
import java.util.Iterator;
/**
*
* The Class SecurityAgent.
*/
public class SecurityAgent
{
@ -30,7 +30,12 @@ public class SecurityAgent
private Groups permissions;
/**
* Instantiates a new security agent.
*
* @param path
* the path
* @throws Exception
* the exception
*/
public SecurityAgent(final String path) throws Exception
{
@ -40,7 +45,13 @@ public class SecurityAgent
}
/**
* Authenticate.
*
* @param login
* the login
* @param password
* the password
* @return true, if successful
*/
public boolean authenticate(final String login, final String password)
{
@ -66,7 +77,13 @@ public class SecurityAgent
}
/**
* Check permission.
*
* @param url
* the url
* @param login
* the login
* @return true, if successful
*/
public boolean checkPermission(final String url, final String login)
{
@ -124,7 +141,9 @@ public class SecurityAgent
}
/**
* Groups.
*
* @return the groups
*/
public Groups groups()
{
@ -137,7 +156,9 @@ public class SecurityAgent
}
/**
* Permissions.
*
* @return the groups
*/
public Groups permissions()
{
@ -150,7 +171,9 @@ public class SecurityAgent
}
/**
* Users.
*
* @return the users
*/
public Users users()
{

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -19,7 +19,7 @@
package fr.devinsy.kiss4web.security;
/**
*
* The Class User.
*/
public class User
{
@ -29,7 +29,7 @@ public class User
private String email;
/**
*
* Instantiates a new user.
*/
public User()
{
@ -40,7 +40,9 @@ public class User
}
/**
* Email.
*
* @return the string
*/
public String email()
{
@ -53,7 +55,9 @@ public class User
}
/**
* Login.
*
* @return the string
*/
public String login()
{
@ -66,7 +70,9 @@ public class User
}
/**
* Password.
*
* @return the string
*/
public String password()
{
@ -79,7 +85,9 @@ public class User
}
/**
* Real name.
*
* @return the string
*/
public String realName()
{
@ -92,7 +100,11 @@ public class User
}
/**
* Sets the email.
*
* @param email
* the email
* @return the user
*/
public User setEmail(final String email)
{
@ -103,7 +115,11 @@ public class User
}
/**
* Sets the login.
*
* @param login
* the login
* @return the user
*/
public User setLogin(final String login)
{
@ -114,7 +130,11 @@ public class User
}
/**
* Sets the password.
*
* @param password
* the password
* @return the user
*/
public User setPassword(final String password)
{
@ -125,7 +145,11 @@ public class User
}
/**
* Sets the real name.
*
* @param realName
* the real name
* @return the user
*/
public User setRealName(final String realName)
{
@ -136,7 +160,7 @@ public class User
}
/**
*
* {@inheritDoc}
*/
@Override
public String toString()

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2010, 2013-2014 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -22,22 +22,26 @@ import java.util.Iterator;
import java.util.Vector;
/**
*
* The Class Users.
*/
public class Users extends Vector<User>
{
private static final long serialVersionUID = 6140538630004281217L;
/**
*
* Instantiates a new users.
*/
public Users()
{
super();
}
/*
/**
* Contains.
*
* @param login
* the login
* @return true, if successful
*/
public boolean contains(final String login)
{
@ -57,7 +61,11 @@ public class Users extends Vector<User>
}
/**
* Gets the by login.
*
* @param login
* the login
* @return the by login
*/
public User getByLogin(final String login)
{
@ -96,7 +104,7 @@ public class Users extends Vector<User>
}
/**
*
* {@inheritDoc}
*/
@Override
public String toString()
@ -119,5 +127,3 @@ public class Users extends Vector<User>
return (result);
}
}
// ////////////////////////////////////////////////////////////////////////

View file

@ -1,5 +1,5 @@
/**
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
* Copyright (C) 2006-2023 Christian Pierre MOMON
*
* This file is part of Kiss4web.
*
@ -23,12 +23,18 @@ import java.util.Iterator;
import java.util.Properties;
/**
*
* The Class UsersFileReader.
*/
public class UsersFileReader
{
/**
* Load.
*
* @param fileName
* the file name
* @return the users
* @throws Exception
* the exception
*/
public static Users load(final String fileName) throws Exception
{
@ -69,5 +75,3 @@ public class UsersFileReader
return (result);
}
}
// ////////////////////////////////////////////////////////////////////////