BEA Systems, Inc.

com.beasys.commerce.axiom.jsp
Class JspBeanBase

java.lang.Object
  |
  +--com.beasys.commerce.axiom.jsp.JspBeanBase
Direct Known Subclasses:
ClassifierPhraseBean, ContentViewBean, PortalJspBean, PortalLayoutJspBean, PortalRemoveJspBean, UserRegistrationBean

public abstract class JspBeanBase
extends java.lang.Object
implements java.io.Serializable

This class is the base class for many JSP Beans that are instantiated from the <jsp:usebean> JSP tag.

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_CATEGORY
          Reserved for later use.
 
Constructor Summary
JspBeanBase()
           
 
Method Summary
 boolean findStringInArray(java.lang.String[] array, java.lang.String str)
          Returns true if an array of strings contains an exact match (case sensative) for the string passed in.
static boolean hasSpecialHTMLChars(java.lang.String value)
          Determines if a string has special HTML characters in it.
static boolean isStringLetterOrDigit(java.lang.String value)
          Determines if a string is a letter or digit.
 java.lang.String validateDoubleValue(java.lang.String fieldName, double value, double min, double max)
          Validates the content value of a double.
 java.lang.String validateDoubleValue(java.lang.String fieldName, java.lang.String value, double min, double max)
          Validates the content value of an double represented as a string.
static java.lang.String validateGroupName(java.lang.String fieldName, java.lang.String groupname, int maxLength)
          A helper method that validates a group name.
 java.lang.String validateIntValue(java.lang.String fieldName, int value, int min, int max)
          Validates the content value of an integer field.
 java.lang.String validateIntValue(java.lang.String fieldName, java.lang.String value, int min, int max)
          Validates the content value of an integer represented as a string.
 java.lang.String validateLength(java.lang.String fieldName, int length, int minLength, int maxLength)
          Validates the content length of a field.
static java.lang.String validateUserName(java.lang.String fieldName, java.lang.String username, int maxLength)
          A helper method that validates the user name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CATEGORY

public static final java.lang.String DEFAULT_CATEGORY
Reserved for later use.
Constructor Detail

JspBeanBase

public JspBeanBase()
Method Detail

validateLength

public java.lang.String validateLength(java.lang.String fieldName,
                                       int length,
                                       int minLength,
                                       int maxLength)
Validates the content length of a field.
Parameters:
fieldName - The name of the screen field.
length - The length of the content in the field.
minLength - The minimum length of the field.
maxLength - The maximum length of the field.
Returns:
null if no error, else an error string.

validateIntValue

public java.lang.String validateIntValue(java.lang.String fieldName,
                                         int value,
                                         int min,
                                         int max)
Validates the content value of an integer field.
Parameters:
fieldName - The name of the screen field.
value - The content integer value.
min - The minimum value of the field.
max - The maximum value of the field.
Returns:
null if no error, else an error string.

validateIntValue

public java.lang.String validateIntValue(java.lang.String fieldName,
                                         java.lang.String value,
                                         int min,
                                         int max)
Validates the content value of an integer represented as a string. Coerces the string to an integer value.
Parameters:
fieldName - The name of the screen field.
value - The content integer value as a String.
min - The minimum value of the field.
max - The maximum value of the field.
Returns:
null if no error, else an error string.

validateDoubleValue

public java.lang.String validateDoubleValue(java.lang.String fieldName,
                                            double value,
                                            double min,
                                            double max)
Validates the content value of a double.
Parameters:
fieldName - The name of the screen field.
value - The content double value.
min - The minimum value of the field.
max - The maximum value of the field.
Returns:
null if no error, else an error string.

validateDoubleValue

public java.lang.String validateDoubleValue(java.lang.String fieldName,
                                            java.lang.String value,
                                            double min,
                                            double max)
Validates the content value of an double represented as a string. Coerces the string to a double value.
Parameters:
fieldName - The name of the screen field.
value - The content double value as a String.
min - The minimum value of the field.
max - The maximum value of the field.
Returns:
null if no error, else an error string.

isStringLetterOrDigit

public static boolean isStringLetterOrDigit(java.lang.String value)
Determines if a string is a letter or digit.
Parameters:
value - The content string value. This value should not be null or an empty string.
Returns:
true if the string is a letter or digit; false if not.

hasSpecialHTMLChars

public static boolean hasSpecialHTMLChars(java.lang.String value)
Determines if a string has special HTML characters in it. Special HTML characters are:
Character Decimal Entity
"

&#34;

&quot;

&

&#38;

&amp;

<

&#60;

&lt;

>

&#62;

&gt;

non-breaking space

&#160;

&nbsp;

Parameters:
value - The content string value.
Returns:
true if the string contains special HTML characters; false if not.

validateUserName

public static java.lang.String validateUserName(java.lang.String fieldName,
                                                java.lang.String username,
                                                int maxLength)
A helper method that validates the user name. The user name is required to be letters or digits only.
Parameters:
fieldName - The name of the screen field.
username - The username String.
Returns:
String - An error string if an error, else it returns null if sucessful.

validateGroupName

public static java.lang.String validateGroupName(java.lang.String fieldName,
                                                 java.lang.String groupname,
                                                 int maxLength)
A helper method that validates a group name. The group name is required to be any character except special HTML character such as &, <, >, and ".
Parameters:
fieldName - The name of the screen field.
username - The groupname String.
Returns:
String - An error string if an error, else it returns null if sucessful.

findStringInArray

public boolean findStringInArray(java.lang.String[] array,
                                 java.lang.String str)
Returns true if an array of strings contains an exact match (case sensative) for the string passed in.
Parameters:
array - An array of Strings.
str - A string to find in the array.
Returns:
true if found, false if not found.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved