All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sfm.reflect.PropertyMatchingSetterVisitor Maven / Gradle / Ivy

package org.sfm.reflect;

import org.sfm.utils.PropertyNameMatcher;

public final class PropertyMatchingSetterVisitor implements SetterVisitor{

	private final PropertyNameMatcher nameMatcher;
	private Setter matchedSetter;
	
	public PropertyMatchingSetterVisitor(final PropertyNameMatcher nameMatcher) {
		this.nameMatcher = nameMatcher;
	}

	@Override
	public boolean visitSetter(final String property, final Setter setter) {
		if (nameMatcher.matches(property)) {
			matchedSetter = setter;
			return false;
		}
		return true;
	}
	
	public Setter setter() {
		return matchedSetter;
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy