Skip to content

Commit cdb44b6

Browse files
committed
Rename internal class names for clarity
1 parent 92b4d11 commit cdb44b6

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/main/java/org/nibor/autolink/LinkExtractor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.nibor.autolink.internal.EmailScanner;
44
import org.nibor.autolink.internal.Scanner;
55
import org.nibor.autolink.internal.UrlScanner;
6-
import org.nibor.autolink.internal.WwwUrlScanner;
6+
import org.nibor.autolink.internal.WwwScanner;
77

88
import java.util.*;
99

@@ -18,7 +18,7 @@ public class LinkExtractor {
1818
private final Scanner wwwScanner;
1919
private final Scanner emailScanner;
2020

21-
private LinkExtractor(UrlScanner urlScanner, WwwUrlScanner wwwScanner, EmailScanner emailScanner) {
21+
private LinkExtractor(UrlScanner urlScanner, WwwScanner wwwScanner, EmailScanner emailScanner) {
2222
this.urlScanner = urlScanner;
2323
this.wwwScanner = wwwScanner;
2424
this.emailScanner = emailScanner;
@@ -93,7 +93,7 @@ public Builder emailDomainMustHaveDot(boolean emailDomainMustHaveDot) {
9393
*/
9494
public LinkExtractor build() {
9595
UrlScanner urlScanner = linkTypes.contains(LinkType.URL) ? new UrlScanner() : null;
96-
WwwUrlScanner wwwScanner = linkTypes.contains(LinkType.WWW) ? new WwwUrlScanner() : null;
96+
WwwScanner wwwScanner = linkTypes.contains(LinkType.WWW) ? new WwwScanner() : null;
9797
EmailScanner emailScanner = linkTypes.contains(LinkType.EMAIL) ? new EmailScanner(emailDomainMustHaveDot) : null;
9898
return new LinkExtractor(urlScanner, wwwScanner, emailScanner);
9999
}

src/main/java/org/nibor/autolink/internal/WwwUrlScanner.java renamed to src/main/java/org/nibor/autolink/internal/WwwScanner.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
import org.nibor.autolink.LinkType;
55

66
/**
7-
* Scan for URLs starting from the trigger character "w", requires "www.".
7+
* Scan for WWW addresses such as "www.example.org" starting from the trigger character "w".
8+
* Requires "www." at the beginning and an additional dot in the domain.
89
* <p>
910
* Based on RFC 3986.
1011
*/
11-
public class WwwUrlScanner implements Scanner {
12+
public class WwwScanner implements Scanner {
1213

1314
@Override
1415
public LinkSpan scan(final CharSequence input, int triggerIndex, int rewindIndex) {

src/test/java/org/nibor/autolink/AutolinkWwwUrlTest.java renamed to src/test/java/org/nibor/autolink/AutolinkWwwTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.junit.runners.Parameterized.Parameters;
1111

1212
@RunWith(Parameterized.class)
13-
public class AutolinkWwwUrlTest extends AutolinkTestCase {
13+
public class AutolinkWwwTest extends AutolinkTestCase {
1414

1515
@Parameters(name = "{1}")
1616
public static Iterable<Object[]> data() {

0 commit comments

Comments
 (0)