From 8974e72ae52086dc15c38c9cb6e3022940ce6521 Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 28 Nov 2012 07:39:10 +0000 Subject: [PATCH] Comments are added to satisfy checkstyle. --- .../org/splat/service/dto/DocumentDTO.java | 1 + .../src/org/splat/service/dto/Proxy.java | 72 ++++++---- .../src/org/splat/service/dto/RoleDTO.java | 31 +++-- .../src/org/splat/service/dto/UserDTO.java | 126 ++++++++++++++++-- 4 files changed, 181 insertions(+), 49 deletions(-) diff --git a/Workspace/Siman-Common/src/org/splat/service/dto/DocumentDTO.java b/Workspace/Siman-Common/src/org/splat/service/dto/DocumentDTO.java index c411370..7e7f4c3 100644 --- a/Workspace/Siman-Common/src/org/splat/service/dto/DocumentDTO.java +++ b/Workspace/Siman-Common/src/org/splat/service/dto/DocumentDTO.java @@ -47,6 +47,7 @@ public class DocumentDTO { * Default constructor. */ public DocumentDTO() { + // The empty constructor } /** diff --git a/Workspace/Siman-Common/src/org/splat/service/dto/Proxy.java b/Workspace/Siman-Common/src/org/splat/service/dto/Proxy.java index de0d20f..656322f 100644 --- a/Workspace/Siman-Common/src/org/splat/service/dto/Proxy.java +++ b/Workspace/Siman-Common/src/org/splat/service/dto/Proxy.java @@ -4,45 +4,61 @@ import org.splat.dal.bo.som.ProgressState; import org.splat.service.technical.IndexServiceImpl; /** - * Stand proxy for entities such as Study and Knowledge Element returned by Lucene-based searches. - * This interface provides access to properties of searched entities which can be presented in a result search list - * before loading the corresponding persistent objects from the database (reason for most properties to be returned as - * strings). - * One of these properties is the internal persistent identifier of the object represented by a proxy allowing the - * user of this interface to load the object from the database. + * Stand proxy for entities such as Study and Knowledge Element returned by Lucene-based searches. This interface provides access to + * properties of searched entities which can be presented in a result search list before loading the corresponding persistent objects from + * the database (reason for most properties to be returned as strings). One of these properties is the internal persistent identifier of the + * object represented by a proxy allowing the user of this interface to load the object from the database. * * @see IndexServiceImpl * @see IndexServiceImpl.ObjectProxy - * @author Daniel Brunier-Coulin + * @author Daniel Brunier-Coulin * @copyright OPEN CASCADE 2012 */ public interface Proxy { - String getAuthorName (); + /** + * Get the name of the object author. + * + * @return the author name + */ + String getAuthorName(); -/** - * Returns the internal persistent identifier of the object represented by this proxy. The returned identifier can be used - * for selecting the corresponding persistent object from the database. - * @return the internal persistent identifier of the object represented by this proxy. - */ - Long getIndex (); + /** + * Returns the internal persistent identifier of the object represented by this proxy. The returned identifier can be used for selecting + * the corresponding persistent object from the database. + * + * @return the internal persistent identifier of the object represented by this proxy. + */ + Long getIndex(); - ProgressState getProgressState (); + /** + * Get the progress state of the object. + * + * @return the progress state + */ + ProgressState getProgressState(); -/** - * Returns the external reference number of the object represented by this proxy. The returned reference is formated - * according to the format defined in the configuration file of the application. - * @return the external reference number of the object represented by this proxy. - */ - String getReference (); + /** + * Returns the external reference number of the object represented by this proxy. The returned reference is formated according to the + * format defined in the configuration file of the application. + * + * @return the external reference number of the object represented by this proxy. + */ + String getReference(); - String getTitle (); + /** + * Get a title of the object. + * + * @return the object title + */ + String getTitle(); -/** - * Returns the type of the object represented by this proxy. Depending on the implementation, the returned type may or - * may not be localized in the current locale of final user. - * @return the type of the object represented by this proxy. - */ - String getType (); + /** + * Returns the type of the object represented by this proxy. Depending on the implementation, the returned type may or may not be + * localized in the current locale of final user. + * + * @return the type of the object represented by this proxy. + */ + String getType(); } \ No newline at end of file diff --git a/Workspace/Siman-Common/src/org/splat/service/dto/RoleDTO.java b/Workspace/Siman-Common/src/org/splat/service/dto/RoleDTO.java index 7ac576c..980d1de 100644 --- a/Workspace/Siman-Common/src/org/splat/service/dto/RoleDTO.java +++ b/Workspace/Siman-Common/src/org/splat/service/dto/RoleDTO.java @@ -32,8 +32,11 @@ public class RoleDTO { /** * Initialization constructor. - * @param username user name - * @param role role name + * + * @param username + * user name + * @param role + * role name */ protected RoleDTO(final String username, final String role) { this._username = username; @@ -46,7 +49,9 @@ public class RoleDTO { /** * Add a role. - * @param role the role to add + * + * @param role + * the role to add */ protected void addRole(final String role) { this._name = this._name + "," + role; @@ -54,6 +59,7 @@ public class RoleDTO { /** * Get roles as an array of separate DTOs. + * * @return array of roles */ protected RoleDTO[] toArray() { @@ -71,19 +77,22 @@ public class RoleDTO { // ============================================================================================================================== // In functions below, the role is supposed having previously been extracted as an array. + /** + * Get role name. + * + * @return the role name + */ public String getName() { return _name; } + /** + * Set role name. + * + * @param name + * the role name to set + */ public void setName(final String name) { _name = name; } - - public boolean is(final String name) { - return this._name.equals(name); - } - - public boolean isSame(final RoleDTO other) { - return this._name.equals(other._name); - } } \ No newline at end of file diff --git a/Workspace/Siman-Common/src/org/splat/service/dto/UserDTO.java b/Workspace/Siman-Common/src/org/splat/service/dto/UserDTO.java index 0109dac..5f5f09a 100644 --- a/Workspace/Siman-Common/src/org/splat/service/dto/UserDTO.java +++ b/Workspace/Siman-Common/src/org/splat/service/dto/UserDTO.java @@ -6,18 +6,42 @@ import org.splat.kernel.Name; /** * User DTO. - * + * * @author Roman Kozlov (RKV) */ public class UserDTO implements Principal, Name { - private String _password; // Property without getter function - private String _username; // Unique in the user directory + /** + * User password. + */ + private String _password; + /** + * User login name. Unique in the user directory. + */ + private String _username; + /** + * User first name. + */ private String _firstName; + /** + * User family. + */ private String _name; - private String _displayName; // Optional - private RoleDTO _role = new RoleDTO(); // Roles as list (as stored into the database) + /** + * User name to be displayed. Optional. + */ + private String _displayName; + /** + * Roles as list (as stored in the database). + */ + private RoleDTO _role = new RoleDTO(); + /** + * Email address. + */ private String _mailAddress; + /** + * Organization name. + */ private String _organizationName; /** @@ -29,6 +53,11 @@ public class UserDTO implements Principal, Name { // Public member functions // ============================================================================================================================== + /** + * {@inheritDoc} + * + * @see java.lang.Object#equals(java.lang.Object) + */ @Override public boolean equals(final Object item) { boolean res = (item != null); @@ -43,6 +72,11 @@ public class UserDTO implements Principal, Name { return res; } + /** + * Get user display name. + * + * @return the user display name + */ public String getDisplayName() { String res = _displayName; if (res == null) { @@ -51,50 +85,112 @@ public class UserDTO implements Principal, Name { return res; } + /** + * Get user first name. + * + * @return the user first name + */ public String getFirstName() { return _firstName; } + /** + * Set user first name. + * + * @param name + * the first name to set + */ public void setFirstName(final String name) { _firstName = name; } + /** + * Get user email address. + * + * @return the email address + */ public String getMailAddress() { return _mailAddress; } + /** + * Set user email address. + * + * @param addr + * the email address to set + */ public void setMailAddress(final String addr) { _mailAddress = addr; } + /** + * {@inheritDoc} + * + * @see java.security.Principal#getName() + */ public String getName() { return _name; } - + + /** + * Set user family. + * + * @param name + * the user family to set + */ public void setName(final String name) { _name = name; } + /** + * Get user's organization name. + * + * @return the user's organization name + */ public String getOrganizationName() { return _organizationName; } + /** + * Set user's organization name. + * + * @param name + * the user's organization name + */ public void setOrganizationName(final String name) { _organizationName = name; } + /** + * Get user roles names separated by commas. + * + * @return the string containing roles names + */ public String getRoleNames() { return _role.getName(); } + /** + * Get users roles as an array of DTO. + * + * @return the array of roles DTO + */ public RoleDTO[] getRoles() { return _role.toArray(); } + /** + * Get user login name. + * @return the user login name + */ public String getUsername() { return _username; } + /** + * {@inheritDoc} + * @see java.lang.Object#toString() + */ @Override public String toString() { return _name + " " + _firstName; @@ -121,6 +217,7 @@ public class UserDTO implements Principal, Name { /** * Get the password. + * * @return the password */ public String getPassword() { @@ -129,7 +226,9 @@ public class UserDTO implements Principal, Name { /** * Set the password. - * @param password the password to set + * + * @param password + * the password to set */ public void setPassword(final String password) { this._password = password; @@ -137,7 +236,9 @@ public class UserDTO implements Principal, Name { /** * Set the username. - * @param username the username to set + * + * @param username + * the username to set */ public void setUsername(final String username) { this._username = username; @@ -145,6 +246,7 @@ public class UserDTO implements Principal, Name { /** * Get the role. + * * @return the role */ public RoleDTO getRole() { @@ -153,7 +255,9 @@ public class UserDTO implements Principal, Name { /** * Set the role. - * @param role the role to set + * + * @param role + * the role to set */ public void setRole(final RoleDTO role) { this._role = role; @@ -161,7 +265,9 @@ public class UserDTO implements Principal, Name { /** * Set the displayName. - * @param displayName the displayName to set + * + * @param displayName + * the displayName to set */ public void setDisplayName(final String displayName) { _displayName = displayName; -- 2.39.2