|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.webobjects.foundation.NSValidation.ValidationException
er.extensions.validation.ERXValidationException
public class ERXValidationException
ERXValidationExceptions extends the regular
NSValidation.ValidationException
to add template based resolution of the validation exception. See more
information about resolving templates in the ERXValidationFactory
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding |
---|
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.DefaultImplementation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.Utility, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor |
Field Summary | |
---|---|
protected com.webobjects.foundation.NSKeyValueCoding |
_context
holds a reference to the context of the exception |
protected com.webobjects.foundation.NSArray |
additionalExceptions
caches any set additionalExceptions |
static java.lang.String |
CustomMethodException
corresponds to a custom method exception |
protected java.lang.Object |
delegate
holds a reference to the exception delegate |
static java.lang.String |
ExceedsMaximumLengthException
corresponds to a model thrown 'maximum length of attribute exceeded' exception |
static java.lang.String |
InvalidNumberException
corresponds to a number formatter exception |
static java.lang.String |
InvalidValueException
corresponds to a generic 'invalid value' exception |
static org.apache.log4j.Logger |
log
logging support |
static java.lang.String |
MandatoryToManyRelationshipException
corresponds to a model thrown 'manditory toMany relationship' exception |
static java.lang.String |
MandatoryToOneRelationshipException
corresponds to a model thrown 'mandatory toOne relationship' exception |
protected java.lang.String |
message
caches the validation message |
protected java.lang.String |
method
holds the method if one is provided |
static java.lang.String |
NullPropertyException
corresponds to a model thrown 'null property' exception |
protected java.lang.Object |
object
holds the object that failed validation |
static java.lang.String |
ObjectRemovalException
corresponds to a model thrown 'object removal' exception |
static java.lang.String |
ObjectsRemovalException
corresponds to a model thrown 'objects removal' exception |
protected java.lang.String |
targetLanguage
holds the target language if provided |
protected java.lang.String |
type
holds the type of the exception |
protected java.lang.Object |
value
holds the value that failed validation |
static java.lang.String |
ValueConversionException
corresponds to a model thrown 'Error converting value of class' exception |
Fields inherited from class com.webobjects.foundation.NSValidation.ValidationException |
---|
_CLASS, AdditionalExceptionsKey, ValidatedKeyUserInfoKey, ValidatedObjectUserInfoKey |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
---|
_CLASS, NullValue |
Constructor Summary | |
---|---|
ERXValidationException(java.lang.String type,
java.lang.Object object,
java.lang.String key)
Default constructor that builds a validation exception without the failed value specified. |
|
ERXValidationException(java.lang.String type,
java.lang.Object object,
java.lang.String key,
java.lang.Object value)
Default constructor that builds a validation exception based on the type, object, key and failed value.Usually for creating custom validation exceptions the ERXValidationFactory should be used. |
Method Summary | |
---|---|
protected java.lang.String |
_getMessage()
|
com.webobjects.foundation.NSArray |
additionalExceptions()
Cover method to return any additional exceptions that occurred. |
com.webobjects.eoaccess.EOAttribute |
attribute()
Cover method for getting the attribute corresponding to the propertyKey and entity off of the objet. |
com.webobjects.foundation.NSKeyValueCoding |
context()
The current context of the validation exception. |
java.lang.Object |
delegate()
Gets the current delegate for this validation exception. |
java.lang.String |
displayNameForEntity()
Generates a displayable and localized version of the current object's entity name. |
java.lang.String |
displayNameForProperty()
Generates a displayable and localized version of the current propertyKey (also called key). |
com.webobjects.eocontrol.EOEnterpriseObject |
eoObject()
Cover method that casts the object of
the validation exception to an EOEnterpriseObject. |
boolean |
equals(java.lang.Object anotherObject)
Compares this exception to anything else. |
java.lang.String |
getMessage()
Gets the message for this exception. |
int |
hashCode()
|
boolean |
isCustomMethodException()
Convience method to determine if this exception was a custom thrown exception instead of a model thrown exception. |
protected java.lang.String |
localizedDisplayNameForKey(java.lang.String key)
Creates a localized display name for a given key trying to localize it with the current "targetLanguage" or the current localizer. |
java.lang.String |
method()
Returns method name. |
java.lang.Object |
object()
Overrides super implementation to allow for setable object value. |
java.lang.String |
propertyKey()
Cover method for returning the key of
the validation exception under the name propertyKey. |
void |
setAdditionalExceptions(com.webobjects.foundation.NSArray exceptions)
Sets the array of additional exceptions that has occurried. |
void |
setContext(com.webobjects.foundation.NSKeyValueCoding context)
Sets the context that can be used to resolve key bindings in validation templates. |
void |
setDelegate(java.lang.Object obj)
Sets the delegate for the current validation exception. |
void |
setMethod(java.lang.String aMethod)
Sets the custom method name that threw the validation exception. |
void |
setObject(java.lang.Object aValue)
Sets the object that failed validation. |
void |
setTargetLanguage(java.lang.String aValue)
Sets the target language to use when rendering the validation message. |
void |
setType(java.lang.String aType)
Sets the validation type of this exception. |
void |
setValue(java.lang.Object aValue)
Sets the value that failed validation. |
void |
takeValueForKey(java.lang.Object obj,
java.lang.String key)
Implementation of the key value coding. |
java.lang.String |
targetLanguage()
Returns the target language to display the validation message in. |
java.lang.String |
toString()
Returns the formatted description of the validation exception without calling getMessage . |
java.lang.String |
type()
Cover method to return the type of the validation exception. |
java.lang.Object |
value()
Returns the value that failed validation. |
java.lang.Object |
valueForKey(java.lang.String key)
Implementation of key value coding. |
Methods inherited from class com.webobjects.foundation.NSValidation.ValidationException |
---|
aggregateExceptionWithExceptions, exceptionAddingEntriesToUserInfo, exceptionWithObjectAndKey, key, userInfo |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger log
public static final java.lang.String NullPropertyException
public static final java.lang.String InvalidNumberException
public static final java.lang.String InvalidValueException
public static final java.lang.String MandatoryToOneRelationshipException
public static final java.lang.String MandatoryToManyRelationshipException
public static final java.lang.String ObjectRemovalException
public static final java.lang.String ObjectsRemovalException
public static final java.lang.String ExceedsMaximumLengthException
public static final java.lang.String ValueConversionException
public static final java.lang.String CustomMethodException
protected java.lang.String message
protected java.lang.String method
protected java.lang.String type
protected java.lang.Object value
protected java.lang.Object object
protected java.lang.String targetLanguage
protected com.webobjects.foundation.NSArray additionalExceptions
protected volatile com.webobjects.foundation.NSKeyValueCoding _context
protected volatile java.lang.Object delegate
Constructor Detail |
---|
public ERXValidationException(java.lang.String type, java.lang.Object object, java.lang.String key)
ERXValidationFactory
should be used.
type
- of the exception, should be one of the constaints
defined in this class.object
- that is throwing the exceptionkey
- property key that failed validationpublic ERXValidationException(java.lang.String type, java.lang.Object object, java.lang.String key, java.lang.Object value)
ERXValidationFactory
should be used.
type
- of the exception, should be one of the constaints
defined in this class.object
- that is throwing the exceptionkey
- property key that failed validationvalue
- that failed validationMethod Detail |
---|
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
protected java.lang.String _getMessage()
public java.lang.Object valueForKey(java.lang.String key)
valueForKey
in interface com.webobjects.foundation.NSKeyValueCoding
key
- to look up
public void takeValueForKey(java.lang.Object obj, java.lang.String key)
takeValueForKey
in interface com.webobjects.foundation.NSKeyValueCoding
obj
- value to be set on this exceptionkey
- to be setpublic boolean isCustomMethodException()
public java.lang.String method()
public void setMethod(java.lang.String aMethod)
aMethod
- name to be set.public com.webobjects.eocontrol.EOEnterpriseObject eoObject()
object
of
the validation exception to an EOEnterpriseObject.
public java.lang.Object object()
object
in class com.webobjects.foundation.NSValidation.ValidationException
public java.lang.String propertyKey()
key
of
the validation exception under the name propertyKey.
public com.webobjects.eoaccess.EOAttribute attribute()
public java.lang.String type()
public void setType(java.lang.String aType)
aType
- name to set on this validation
exception.public java.lang.Object value()
public void setValue(java.lang.Object aValue)
aValue
- that failed validationpublic void setObject(java.lang.Object aValue)
aValue
- object that failed validationpublic java.lang.String targetLanguage()
public void setTargetLanguage(java.lang.String aValue)
aValue
- name fo the language to render the validation
exception in.public java.lang.Object delegate()
ERXValidationFactory
is returned.
public void setDelegate(java.lang.Object obj)
obj
- delegate to be used for this validation exception.public com.webobjects.foundation.NSKeyValueCoding context()
D2WContext
is set as the current context on the exceptions. If a context
is not set then the contextForException
is called
off of the default ERXValidationFactory
.
When this also returns null, then the exception will be used as its context.
This is needed because of some of the templates in ERDirectToWeb which use
context.propertyKey
and will display ? if none is given.
public void setContext(com.webobjects.foundation.NSKeyValueCoding context)
context
- of the current exceptionpublic void setAdditionalExceptions(com.webobjects.foundation.NSArray exceptions)
exceptions
- array of additional exceptionspublic com.webobjects.foundation.NSArray additionalExceptions()
additionalExceptions
in class com.webobjects.foundation.NSValidation.ValidationException
public java.lang.String displayNameForProperty()
public java.lang.String displayNameForEntity()
protected java.lang.String localizedDisplayNameForKey(java.lang.String key)
key
- to be translated
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object anotherObject)
equals
in class java.lang.Object
public java.lang.String toString()
getMessage
.
toString
in class java.lang.Throwable
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |