ValidationResult cleanObjectKey ( String name ) { ValidationResult vr = new ValidationResult ( ) ; name = name . trim ( ) ; for ( String x : objectKeyCharsNotAllowed ) name = name . replace ( x , "" ) ; if ( name . length ( ) > Constants . MAX_KEY_LENGTH ) { name = name . substring ( 0 , Constants . MAX_KEY_LENGTH - 1 ) ; vr . setErrorDesc ( name . trim ( ) + "... exceeds the limit of " + Constants . MAX_KEY_LENGTH + " characters. Trimmed" ) ; vr . setErrorCode ( 520 ) ; } vr . setObject ( name . trim ( ) ) ; return vr ; }
Cleans the object key .