|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.xui.validation.XBaseValidator
public abstract class XBaseValidator
A basic implementation of the XValidator interface
Copyright: Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt
| Field Summary | |
|---|---|
protected java.lang.Object |
container
Container to be used for validation methods |
protected XProject |
currentProject
The owner project and the context for this object |
protected int |
errorLevel
The level of the errors detected by the validation |
protected java.lang.String |
formattedMessage
The formatted message |
protected boolean |
mandatory
boolean indicating whether component requires input |
protected int |
mask
The event mask of the validation |
protected java.lang.String |
message
The unformatted message to be displayed |
protected boolean |
start
Indicates that the validation has started |
static int |
USE_FAIL_STYLE
|
static int |
USE_NORMAL_STYLE
|
static int |
USE_WARN_STYLE
|
protected java.lang.reflect.Method |
validationMethod
Method to be used for callback validations |
protected java.lang.String |
validationName
The name of the validation which is being handled by this validator |
protected java.lang.String |
value
Used to store the current value contained in the component |
| Fields inherited from interface net.xoetrope.xui.validation.XValidator |
|---|
IGNORE_BLANKS, LEVEL_ERROR, LEVEL_IGNORE, LEVEL_WARNING, MANDATORY, STRICT_CHECK, WEAK_CHECK |
| Constructor Summary | |
|---|---|
XBaseValidator(XProject project)
|
|
| Method Summary | |
|---|---|
void |
applyErrorStyle(java.lang.Object comp,
int errorStatus)
Modify the evaluated component to indicate the error status |
int |
getLevel()
Get the error level of the validations |
int |
getMask()
Get the event mask. |
java.lang.String |
getMessage()
Get the validation message which is formatted after the tokens have been replaced |
java.lang.String |
getName()
Get the name of the validation |
protected java.lang.String |
getText(java.lang.Object c)
Get the text value of the component. |
java.lang.String |
getValueAsString()
Get the value as a string object |
java.lang.Object |
invokeMethod()
Call the funcion to get the value we are validating. |
protected void |
replaceToken(java.lang.String lookup,
java.lang.String replacement)
Carry out a replacement on the validation message |
protected void |
replaceTokens()
Replace any further tokens in the message |
void |
setMask(int newMask)
Set the event mask. |
void |
setName(java.lang.String name)
Set the name of the validation |
void |
setup(XmlElement element)
Set the validation parameters |
static void |
setValidationColors(java.awt.Color[] validationColors)
Set the validation colors |
void |
setValidationMethod(java.lang.reflect.Method m,
java.lang.Object c)
Set the Method of the XPage to be invoked when we are doing a funcion validation |
protected void |
throwException()
Replace the remaining tokens and throw the exception |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.xoetrope.xui.validation.XValidator |
|---|
validate |
| Field Detail |
|---|
public static final int USE_NORMAL_STYLE
public static final int USE_WARN_STYLE
public static final int USE_FAIL_STYLE
protected boolean mandatory
protected java.lang.String message
protected java.lang.String value
protected java.lang.String formattedMessage
protected java.lang.String validationName
protected java.lang.Object container
protected java.lang.reflect.Method validationMethod
protected int mask
protected int errorLevel
protected boolean start
protected XProject currentProject
| Constructor Detail |
|---|
public XBaseValidator(XProject project)
project - the owner project| Method Detail |
|---|
public int getMask()
getMask in interface XValidatorpublic void setMask(int newMask)
newMask - The new mask which is to be used by the validator
public void setValidationMethod(java.lang.reflect.Method m,
java.lang.Object c)
setValidationMethod in interface XValidatorc - The component being validatedm - The method to be invokedpublic java.lang.String getName()
getName in interface XValidatorpublic void setName(java.lang.String name)
name - the new namepublic java.lang.String getMessage()
getMessage in interface XValidatorpublic void setup(XmlElement element)
setup in interface XValidatorelement - the validator parameterspublic java.lang.String getValueAsString()
getValueAsString in interface XValidatorpublic int getLevel()
getLevel in interface XValidatorpublic java.lang.Object invokeMethod()
protected void replaceToken(java.lang.String lookup,
java.lang.String replacement)
lookup - The text to findreplacement - The text to replace the text withprotected void replaceTokens()
protected java.lang.String getText(java.lang.Object c)
c - The component
protected void throwException()
throws java.lang.Exception
java.lang.Exception - Throw an exception so that it can be caught
public void applyErrorStyle(java.lang.Object comp,
int errorStatus)
comp - the validated componenterrorStatus - the error statuspublic static void setValidationColors(java.awt.Color[] validationColors)
validationColors - the validation colors in the following order:
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||