return valueP; throw new com.webobjects.foundation.NSValidation.ValidationException(new StringBuilder().append("The ").append(name()).append(" property of ").append(entity().name()).append(" is not allowed to be null.").toString(), this, name()); throw new com.webobjects.foundation.NSValidation.ValidationException(new StringBuilder().append("Error encountered converting value of class ").append(value.getClass().getName()).append(" to type specified in attribute '").append(name()).append("' of entity '").append(entity().name()).append('\'').toString(), this, name()); throw new com.webobjects.foundation.NSValidation.ValidationException(new StringBuilder().append("Error encountered converting null value to type specified in attribute '").append(name()).append("' of entity '").append(entity().name()).append('\'').toString(), this, name()); int maxLen = width(); if (maxLen != 0) { throw new com.webobjects.foundation.NSValidation.ValidationException(new StringBuilder().append("Error encountered converting value of class ").append(value.getClass().getName()).append(" to type specified in attribute '").append(name()).append("' of entity '").append(entity().name()).append("'. Conversion exception is : ").append(e.getMessage()).toString(), this, name()); currLength = ((NSData) primitiveValue).length(); if (currLength > maxLen) throw new com.webobjects.foundation.NSValidation.ValidationException(new StringBuilder().append("The ").append(name()).append(" property of ").append(entity().name()).append(" exceeds maximum length of ").append(maxLen).append(" characters").toString(), this, name());
/** * Overridden so that parent will handle in the same manner as if this were a dynamic element. * @param t the exception thrown during validation * @param value the given value to be validated * @param keyPath the key path associated with this value, identifies the property of an object */ @Override public void validationFailedWithException(Throwable t, Object value, String keyPath) { if (keyPath != null && "<none>".equals(keyPath) && t instanceof ValidationException) { ValidationException e = (ValidationException) t; WOAssociation valueAssociation = (WOAssociation) _keyAssociations.valueForKey("value"); if (valueAssociation != null) { keyPath = valueAssociation.keyPath(); } t = new ValidationException(e.getMessage(), e.object(), keyPath); } parent().validationFailedWithException(t, value, keyPath); }
ValidationException validationexception = new ValidationException(parseexception.getMessage(), strValue, valueKeyPath); component.validationFailedWithException(validationexception, strValue, valueKeyPath); return null;
/** * Overridden so that parent will handle in the same manner as if this were a dynamic element. * @param t the exception thrown during validation * @param value the given value to be validated * @param keyPath the key path associated with this value, identifies the property of an object */ @Override public void validationFailedWithException(Throwable t, Object value, String keyPath) { if (keyPath != null && "<none>".equals(keyPath) && t instanceof ValidationException) { ValidationException e = (ValidationException) t; WOAssociation valueAssociation = (WOAssociation) _keyAssociations.valueForKey("value"); if (valueAssociation != null) { keyPath = valueAssociation.keyPath(); } t = new ValidationException(e.getMessage(), e.object(), keyPath); } parent().validationFailedWithException(t, value, keyPath); }
public Object validateParent(Component newParent) { if (!okToSetParent(this, newParent)) throw new NSValidation.ValidationException("Sorry: the parent-child relationship you are setting would create a cycle"); return null; }
public Object validateTargetReleaseForNewBugs() throws NSValidation.ValidationException { Release release = targetRelease(); if (release != null) { if (!release.isOpen()) throw new NSValidation.ValidationException("Sorry, the release <b>"+release.valueForKey("name")+"</b> is closed. Bugs/Requirements can only be attached to open releases" ); } return null; }