public boolean isInstance ( CharSequence value ) { // Check the value is under the maximum if one is set. // Check the value matches the pattern if one is set. return ( ( maxLength <= 0 ) || ( value . length ( ) <= maxLength ) ) && compiledPattern . matcher ( value ) . matches ( ) ; }
Checks a string value against this type to see if it is a valid instance of the type .