Back to project page Joetz-Android-V2.
The source code is released under:
GNU General Public License
If you think the Android project Joetz-Android-V2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.jens.myapplication.domain.binding; //from ww w .j a v a 2 s. c o m import android.widget.EditText; import com.example.jens.myapplication.domain.User; import com.example.jens.myapplication.domain.validator.UserValidator; import java.util.List; /** * Created by Sam on 29/10/2014. */ public class UserValidatorBinding extends ValidatorBinding<UserValidator> { public static final int FIELD_PASSWORD = 0; /** * * @param validator * @param view * @param field * @param itemName (optional: null) */ public UserValidatorBinding(UserValidator validator, EditText view, int field, String itemName){ super(validator, view, field, itemName); } @Override protected void setValue(String value){ User u = validator.getObj(); switch(field){ case FIELD_PASSWORD: u.setPassword(value); break; } } public void fillValue(){ User u = validator.getObj(); switch(field){ case FIELD_PASSWORD: view.setText(u.getPassword()); break; } } @Override protected ValidationTask createTask(int field) { switch(field){ case FIELD_PASSWORD: { return new ValidationTask() { @Override public List<Integer> validate(List<Integer> errors) { return validator.validatePassword(errors); } }; } } return null; } }