// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
package dyndi.params;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.springframework.stereotype.Component;

@Component
public class ParamSSFactory implements ParamFactory {
    private static Pattern valueSS = Pattern.compile("(\\S+) \\((\\S+)\\)");
    private Matcher m;
    public void init(String allvalues) {
        m = valueSS.matcher(allvalues);
    }
    public boolean isMatch() {
        return m.matches();
    }
    public Param createParam(String name) {
        return new Param2Value<String, String>(name, m.group(1), m.group(2));
    }
}
