Copyright @ 2002 SAP. All Rights Reserved.

com.sap.tc.complib.namecheck
Class NameCheckException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.sap.tc.complib.validate.ValidationException
                    |
                    +--com.sap.tc.complib.namecheck.NameCheckException
All Implemented Interfaces:
java.io.Serializable

public class NameCheckException
extends ValidationException

A NameCheckException is used by the name checker to report invalid names.

See Also:
Serialized Form

Field Summary
static int ERROR_EMPTY_STRING
          The string to be checked is empty
static int ERROR_ILLEGAL_CHARACTER
          A character was found which is not part of the character set allowed for this type of name.
static int ERROR_ILLEGAL_END
          The name ends with a character not allowed at this position.
static int ERROR_ILLEGAL_SECTION_END
          A section of a structured name ends with a character not allowed at this position.
static int ERROR_ILLEGAL_SECTION_START
          A section of a structured name starts with a character not allowed at this position.
static int ERROR_NAME_TOO_LONG
          The name is too long.
static int ERROR_RESERVED_SEGMENT
          The name contains a reserved word as a name segment.
 
Constructor Summary
NameCheckException(java.lang.String message, java.lang.String checkedString, int error, int position)
          Constructs a new NameCheckException.
 
Method Summary
 java.lang.String getCheckedString()
          Returns the checked string.
 int getError()
          get the error code.
 int getErrorPosition()
          Returns the position of the error in the name (staring with 0).
 java.lang.String getMessage()
          Returns the exception message.
 
Methods inherited from class com.sap.tc.complib.validate.ValidationException
getCause, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_EMPTY_STRING

public static final int ERROR_EMPTY_STRING
The string to be checked is empty

ERROR_ILLEGAL_SECTION_START

public static final int ERROR_ILLEGAL_SECTION_START
A section of a structured name starts with a character not allowed at this position.

ERROR_ILLEGAL_SECTION_END

public static final int ERROR_ILLEGAL_SECTION_END
A section of a structured name ends with a character not allowed at this position.

ERROR_ILLEGAL_CHARACTER

public static final int ERROR_ILLEGAL_CHARACTER
A character was found which is not part of the character set allowed for this type of name.

ERROR_ILLEGAL_END

public static final int ERROR_ILLEGAL_END
The name ends with a character not allowed at this position.

ERROR_NAME_TOO_LONG

public static final int ERROR_NAME_TOO_LONG
The name is too long. In this case the property getErrorPosition() returns the allowed maximum

ERROR_RESERVED_SEGMENT

public static final int ERROR_RESERVED_SEGMENT
The name contains a reserved word as a name segment. In this case the property getErrorPosition() returns the start position of this segment
Constructor Detail

NameCheckException

public NameCheckException(java.lang.String message,
                          java.lang.String checkedString,
                          int error,
                          int position)
Constructs a new NameCheckException.
Parameters:
message - the exception message text
checkedString - the name being checked when the exception occured
error - the error code (see getError() )
position - the position of error in the checked string (starting with 0)
Method Detail

getError

public int getError()
get the error code.
Returns:
error code as an integer. Codes are defined as constants ERROR_* in this class.

getErrorPosition

public int getErrorPosition()
Returns the position of the error in the name (staring with 0).

getCheckedString

public java.lang.String getCheckedString()
Returns the checked string.

getMessage

public java.lang.String getMessage()
Returns the exception message.
Overrides:
getMessage in class ValidationException

Copyright @ 2002 SAP. All Rights Reserved.