Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom converters have no access to field's meta-data #57

Open
cr3ativ3 opened this issue Mar 22, 2018 · 0 comments
Open

Custom converters have no access to field's meta-data #57

cr3ativ3 opened this issue Mar 22, 2018 · 0 comments

Comments

@cr3ativ3
Copy link
Contributor

cr3ativ3 commented Mar 22, 2018

Custom converters have limited usefullnes since they cannot access meta-information about the field they're converting.

public class CreditCardView {
     ...
    @MaskedField
    @Selector(value="#credit-card-number", converter=CustomStringConverter.class)
    private String creditCardNumber;
    ...
}

public class CustomStringConverter implements ElementConverter<String> {

    @Override
    public String convert(Element node, Selector selector) {
        // would mask this field as 1234-5678-9012 -> ****-****-****-9012 , but cannot
        // know it's a @MaskedField since it has no access to field or its annotations
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants