/** * Picky setter for occurrence fields. Validates user input to be conform * the (Symyx) specification. * @param occurrence occurence value */ public void setOccurrence(String occurrence) throws CDKException { if (occurrence == null || occurrence.equals("")) { occurrence = ">0"; //revert to default } else { occurrence = occurrence.trim().replaceAll(" ", ""); if (isValidOccurrenceSyntax(occurrence)) { this.occurrence = occurrence; } else throw new CDKException("Invalid occurence line: " + occurrence); } }
if (userOccurrenceText.trim().equals("") || !RGroupList.isValidOccurrenceSyntax(userOccurrenceText)) { throw new RuntimeException (GT.get("Invalid occurrence specified for {0}", "R" + r));