public boolean isValid(){
  String value;
  if (thisone == null) {
    return false;
  }
  value=getText();
  if (fieldType == FieldType.TEXT) {
    if ((value.length() < 1) && (allow0Length == false)) {
      return false;
    }
 else     if (((allow0Length == true) && (value.length() == 0)) || (value.matches(validateRegExpr))) {
      return true;
    }
 else {
      return false;
    }
  }
 else   if (fieldType == FieldType.INTEGRALNUMERIC) {
    try {
      if ((allow0Length == true) && (value.length() == 0)) {
        return true;
      }
 else       if (value.length() == 0) {
        return false;
      }
 else       if ((Integer.parseInt(value) >= minAllowedValue) && (Integer.parseInt(value) <= maxAllowedValue)) {
        return true;
      }
 else {
        return false;
      }
    }
 catch (    Exception e) {
      return false;
    }
  }
 else   if (fieldType == FieldType.INTEGRALNUMERICPLUSSTRING) {
    Integer findLocation=999;
    Integer location=999;
    if ((allow0Length == true) && (value.length() == 0)) {
      return true;
    }
 else     if (value.length() == 0) {
      return false;
    }
    location=value.indexOf('c');
    if ((location != -1) && (location < findLocation)) {
      findLocation=location;
    }
    location=value.indexOf('C');
    if ((location != -1) && (location < findLocation)) {
      findLocation=location;
    }
    location=value.indexOf('t');
    if ((location != -1) && (location < findLocation)) {
      findLocation=location;
    }
    location=value.indexOf('T');
    if ((location != -1) && (location < findLocation)) {
      findLocation=location;
    }
    if (findLocation == 999) {
      return false;
    }
    try {
      Integer address=Integer.parseInt(value.substring(0,findLocation));
      if ((address < minAllowedValue) || (address > maxAllowedValue)) {
        return false;
      }
 else       if ((value.length() < 2) || (!value.matches(validateRegExpr))) {
        return false;
      }
 else {
        return true;
      }
    }
 catch (    Exception e) {
      return false;
    }
  }
 else   if (fieldType == FieldType.LIMITEDHEX) {
    try {
      if (value.length() == 0) {
        return false;
      }
 else       if ((Integer.parseInt(value,16) >= minAllowedValue) && (Integer.parseInt(value,16) <= maxAllowedValue)) {
        return true;
      }
 else {
        return false;
      }
    }
 catch (    Exception e) {
      return false;
    }
  }
 else {
    return false;
  }
}

public boolean isValid ( ) { String value ; if ( thisone == null ) { return false ; } value = getText ( ) ; if ( fieldType == FieldType . TEXT ) { if ( ( value . length ( ) < 1 ) && ( allow0Length == false ) ) { return false ; } else if ( ( ( allow0Length == true ) && ( value . length ( ) == 0 ) ) || ( value . matches ( validateRegExpr ) ) ) { return true ; } else { return false ; } } else if ( fieldType == FieldType . INTEGRALNUMERIC ) { try { if ( ( allow0Length == true ) && ( value . length ( ) == 0 ) ) { return true ; } else if ( value . length ( ) == 0 ) { return false ; } else if ( ( Integer . parseInt ( value ) >= minAllowedValue ) && ( Integer . parseInt ( value ) <= maxAllowedValue ) ) { return true ; } else { return false ; } } catch ( Exception e ) { return false ; } } else if ( fieldType == FieldType . INTEGRALNUMERICPLUSSTRING ) { Integer findLocation = 999 ; Integer location = 999 ; if ( ( allow0Length == true ) && ( value . length ( ) == 0 ) ) { return true ; } else if ( value . length ( ) == 0 ) { return false ; } location = value . indexOf ( 'c' ) ; if ( ( location != - 1 ) && ( location < findLocation ) ) { findLocation = location ; } location = value . indexOf ( 'C' ) ; if ( ( location != - 1 ) && ( location < findLocation ) ) { findLocation = location ; } location = value . indexOf ( 't' ) ; if ( ( location != - 1 ) && ( location < findLocation ) ) { findLocation = location ; } location = value . indexOf ( 'T' ) ; if ( ( location != - 1 ) && ( location < findLocation ) ) { findLocation = location ; } if ( findLocation == 999 ) { return false ; } try { Integer address = Integer . parseInt ( value . substring ( 0 , findLocation ) ) ; if ( ( address < minAllowedValue ) || ( address > maxAllowedValue ) ) { return false ; } else if ( ( value . length ( ) < 2 ) || ( ! value . matches ( validateRegExpr ) ) ) { return false ; } else { return true ; } } catch ( Exception e ) { return false ; } } else if ( fieldType == FieldType . LIMITEDHEX ) { try { if ( value . length ( ) == 0 ) { return false ; } else if ( ( Integer . parseInt ( value , 16 ) >= minAllowedValue ) && ( Integer . parseInt ( value , 16 ) <= maxAllowedValue ) ) { return true ; } else { return false ; } } catch ( Exception e ) { return false ; } } else { return false ; } }
validates the field information . does not make any gui changes . a field value that is zero - length is considered invalid .
