@SuppressWarnings("unchecked") @Override public <T> IParserResult<T> createParser(String scan) throws ParsingException { // TODO trim trailing whitespace first? final Matcher scanCommandMatcher = scanCommandPattern.matcher(scan); final boolean matchFound = scanCommandMatcher.find(); if (!matchFound) { // TODO: using a single regex to match the whole scan command // doesn't appear to make it very easy to say what's wrong with the command throw new ParsingException("Invalid scan command: " + scan); } // TODO other models besides StepModel? what determines type T? final ParserImpl parser = new ParserImpl(scan); // parse the scannables string final String scannablesString = scanCommandMatcher.group(GROUP_NAME_SCANNABLES); final LinkedHashMap<String, StepModel> scannableModels = parseScannables(scannablesString); parser.setScannables(scannableModels); // parser the detectors string final String detectorsString = scanCommandMatcher.group(GROUP_NAME_DETECTORS); final LinkedHashMap<String, Number> detectorExposures = parseDetectors(detectorsString); parser.setDetectors(detectorExposures); return (IParserResult<T>) parser; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case EveDescPackage.DIRECT_OBJECT_PARSER__TYPE: setType((JvmTypeReference) null); return; } super.eUnset(featureID); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case EveDescPackage.DIRECT_OBJECT_PARSER__TYPE: setType((JvmTypeReference) newValue); return; } super.eSet(featureID, newValue); }