Apache Commons EmailValidator Override isValidDomain
up vote
1
down vote
favorite
I'm using the Apache Commons Email validator
I want to override the isValidDomain
method, but I can't because this class has defined it with a non public constructor.
Is there anyway I can get around this besides re-writing the whole class again?
java apache-commons protected
add a comment |
up vote
1
down vote
favorite
I'm using the Apache Commons Email validator
I want to override the isValidDomain
method, but I can't because this class has defined it with a non public constructor.
Is there anyway I can get around this besides re-writing the whole class again?
java apache-commons protected
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm using the Apache Commons Email validator
I want to override the isValidDomain
method, but I can't because this class has defined it with a non public constructor.
Is there anyway I can get around this besides re-writing the whole class again?
java apache-commons protected
I'm using the Apache Commons Email validator
I want to override the isValidDomain
method, but I can't because this class has defined it with a non public constructor.
Is there anyway I can get around this besides re-writing the whole class again?
java apache-commons protected
java apache-commons protected
edited Nov 8 at 12:43
user7294900
19.1k93057
19.1k93057
asked Nov 8 at 6:56
Richie
1,875747103
1,875747103
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Method has protected
access so you can create and use your own class extending it and override the method:
public class MyEmailValidator extends EmailValidator {
private static final long serialVersionUID = 1L; // Should be Serializable
@Override
protected boolean isValidDomain(String domain) {
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Method has protected
access so you can create and use your own class extending it and override the method:
public class MyEmailValidator extends EmailValidator {
private static final long serialVersionUID = 1L; // Should be Serializable
@Override
protected boolean isValidDomain(String domain) {
add a comment |
up vote
0
down vote
accepted
Method has protected
access so you can create and use your own class extending it and override the method:
public class MyEmailValidator extends EmailValidator {
private static final long serialVersionUID = 1L; // Should be Serializable
@Override
protected boolean isValidDomain(String domain) {
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Method has protected
access so you can create and use your own class extending it and override the method:
public class MyEmailValidator extends EmailValidator {
private static final long serialVersionUID = 1L; // Should be Serializable
@Override
protected boolean isValidDomain(String domain) {
Method has protected
access so you can create and use your own class extending it and override the method:
public class MyEmailValidator extends EmailValidator {
private static final long serialVersionUID = 1L; // Should be Serializable
@Override
protected boolean isValidDomain(String domain) {
answered Nov 8 at 7:10
user7294900
19.1k93057
19.1k93057
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53202775%2fapache-commons-emailvalidator-override-isvaliddomain%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown