public static Type from(String name) { for (Type type : Type.values()) { if (type.name.equals(name)) return type; } throw new IllegalArgumentException("Unknown position filter: " + name); }
public void init(Matcher matcher) { positions = new ArrayList<Position>(); do { Position position = new Position(Type.from(matcher.group(1))); if (matcher.group(2) != null) position.parameters = matcher.group(2); positions.add(position); } while (matcher.find()); }
public boolean matches(JComponent component, int index, int size) { return type.matches(parameters, component, index, size); }