Skip to content

Commit 17f46b8

Browse files
committed
rename UrlIdHandler to UIHFactory
1 parent 9bda761 commit 17f46b8

57 files changed

Lines changed: 369 additions & 427 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extractor/src/main/java/org/schabi/newpipe/extractor/Extractor.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ public abstract class Extractor {
1414
*/
1515
private final StreamingService service;
1616

17-
private final UrlIdHandler urlIdHandler;
17+
private final UIHFactory UIHFactory;
1818

1919
@Nullable
2020
private boolean pageFetched = false;
2121
private final Downloader downloader;
2222

23-
public Extractor(final StreamingService service, final UrlIdHandler urlIdHandler) {
23+
public Extractor(final StreamingService service, final UIHFactory UIHFactory) {
2424
if(service == null) throw new NullPointerException("service is null");
25-
if(urlIdHandler == null) throw new NullPointerException("UrlIdHandler is null");
25+
if(UIHFactory == null) throw new NullPointerException("UIHFactory is null");
2626
this.service = service;
27-
this.urlIdHandler = urlIdHandler;
27+
this.UIHFactory = UIHFactory;
2828
this.downloader = NewPipe.getDownloader();
2929
if(downloader == null) throw new NullPointerException("downloader is null");
3030
}
3131

3232
/**
33-
* @return The {@link UrlIdHandler} of the current extractor object (e.g. a ChannelExtractor should return a channel url handler).
33+
* @return The {@link UIHFactory} of the current extractor object (e.g. a ChannelExtractor should return a channel url handler).
3434
*/
3535
@Nonnull
36-
public UrlIdHandler getUrlIdHandler() {
37-
return urlIdHandler;
36+
public UIHFactory getUIHFactory() {
37+
return UIHFactory;
3838
}
3939

4040
/**
@@ -66,7 +66,7 @@ protected boolean isPageFetched() {
6666

6767
@Nonnull
6868
public String getId() throws ParsingException {
69-
return urlIdHandler.getId();
69+
return UIHFactory.getId();
7070
}
7171

7272
/**
@@ -79,12 +79,12 @@ public String getId() throws ParsingException {
7979

8080
@Nonnull
8181
public String getOriginalUrl() throws ParsingException {
82-
return urlIdHandler.getOriginalUrl();
82+
return UIHFactory.getOriginalUrl();
8383
}
8484

8585
@Nonnull
8686
public String getUrl() throws ParsingException {
87-
return urlIdHandler.getUrl();
87+
return UIHFactory.getUrl();
8888
}
8989

9090
@Nonnull

extractor/src/main/java/org/schabi/newpipe/extractor/Info.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public abstract class Info implements Serializable {
1818
/**
1919
* Different than the {@link #originalUrl} in the sense that it <i>may</i> be set as a cleaned url.
2020
*
21-
* @see UrlIdHandler#getUrl()
21+
* @see UIHFactory#getUrl()
2222
* @see Extractor#getOriginalUrl()
2323
*/
2424
private final String url;
@@ -48,11 +48,11 @@ public Info(int serviceId, String id, String url, String originalUrl, String nam
4848
this.name = name;
4949
}
5050

51-
public Info(int serviceId, UrlIdHandler urlIdHandler, String name) throws ParsingException {
51+
public Info(int serviceId, UIHFactory UIHFactory, String name) throws ParsingException {
5252
this(serviceId,
53-
urlIdHandler.getId(),
54-
urlIdHandler.getUrl(),
55-
urlIdHandler.getOriginalUrl(),
53+
UIHFactory.getId(),
54+
UIHFactory.getUrl(),
55+
UIHFactory.getOriginalUrl(),
5656
name);
5757
}
5858

extractor/src/main/java/org/schabi/newpipe/extractor/ListExtractor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
public abstract class ListExtractor<R extends InfoItem> extends Extractor {
1414

15-
public ListExtractor(StreamingService service, ListUrlIdHandler urlIdHandler) {
15+
public ListExtractor(StreamingService service, ListUIHFactory urlIdHandler) {
1616
super(service, urlIdHandler);
1717
}
1818

@@ -50,8 +50,8 @@ public boolean hasNextPage() throws IOException, ExtractionException {
5050
}
5151

5252
@Override
53-
public ListUrlIdHandler getUrlIdHandler() {
54-
return (ListUrlIdHandler) super.getUrlIdHandler();
53+
public ListUIHFactory getUIHFactory() {
54+
return (ListUIHFactory) super.getUIHFactory();
5555
}
5656

5757
/*//////////////////////////////////////////////////////////////////////////

extractor/src/main/java/org/schabi/newpipe/extractor/ListInfo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.schabi.newpipe.extractor;
22

3-
import com.sun.org.apache.xerces.internal.xs.StringList;
43
import org.schabi.newpipe.extractor.exceptions.ParsingException;
54

65
import java.util.ArrayList;
@@ -24,7 +23,7 @@ public ListInfo(int serviceId,
2423
this.sortFilter = sortFilter;
2524
}
2625

27-
public ListInfo(int serviceId, ListUrlIdHandler listUrlIdHandler, String name) throws ParsingException {
26+
public ListInfo(int serviceId, ListUIHFactory listUrlIdHandler, String name) throws ParsingException {
2827
super(serviceId, listUrlIdHandler, name);
2928
this.contentFilter = listUrlIdHandler.getContentFilter();
3029
this.sortFilter = listUrlIdHandler.getSortFilter();

extractor/src/main/java/org/schabi/newpipe/extractor/ListUrlIdHandler.java renamed to extractor/src/main/java/org/schabi/newpipe/extractor/ListUIHFactory.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@
55
import java.util.ArrayList;
66
import java.util.List;
77

8-
public abstract class ListUrlIdHandler extends UrlIdHandler {
8+
public abstract class ListUIHFactory extends UIHFactory {
99

1010
protected List<String> contentFilter = new ArrayList<>(0);
1111
protected String sortFilter = "";
1212

13-
public ListUrlIdHandler setQuery(String id,
14-
List<String> contentFilter,
15-
String sortFilter) throws ParsingException {
13+
public ListUIHFactory setQuery(String id,
14+
List<String> contentFilter,
15+
String sortFilter) throws ParsingException {
1616
setId(id);
1717
this.contentFilter = contentFilter;
1818
this.sortFilter = sortFilter;
1919
return this;
2020
}
2121

2222

23-
public ListUrlIdHandler setQuery(String id) throws ParsingException {
23+
public ListUIHFactory setQuery(String id) throws ParsingException {
2424
setQuery(id, new ArrayList<String>(), "");
2525
return this;
2626
}
2727

28-
public ListUrlIdHandler setUrl(String url) throws ParsingException {
29-
return (ListUrlIdHandler) super.setUrl(url);
28+
public ListUIHFactory setUrl(String url) throws ParsingException {
29+
return (ListUIHFactory) super.setUrl(url);
3030
}
3131

32-
public ListUrlIdHandler setId(String id) throws ParsingException {
33-
return (ListUrlIdHandler) super.setId(id);
32+
public ListUIHFactory setId(String id) throws ParsingException {
33+
return (ListUIHFactory) super.setId(id);
3434
}
3535

3636
/**

extractor/src/main/java/org/schabi/newpipe/extractor/StreamingService.java

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package org.schabi.newpipe.extractor;
22

3-
import com.sun.org.apache.xerces.internal.xs.StringList;
43
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
54
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
65
import org.schabi.newpipe.extractor.exceptions.ParsingException;
76
import org.schabi.newpipe.extractor.kiosk.KioskList;
87
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
9-
import org.schabi.newpipe.extractor.search.SearchEngine;
108
import org.schabi.newpipe.extractor.search.SearchExtractor;
11-
import org.schabi.newpipe.extractor.search.SearchQueryUrlHandler;
9+
import org.schabi.newpipe.extractor.search.SearchQIHFactory;
1210
import org.schabi.newpipe.extractor.stream.StreamExtractor;
1311
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
1412

@@ -69,51 +67,50 @@ public String toString() {
6967
////////////////////////////////////////////
7068
// Url Id handler
7169
////////////////////////////////////////////
72-
public abstract UrlIdHandler getStreamUrlIdHandler();
73-
public abstract ListUrlIdHandler getChannelUrlIdHandler();
74-
public abstract ListUrlIdHandler getPlaylistUrlIdHandler();
75-
public abstract SearchQueryUrlHandler getSearchQueryHandler();
70+
public abstract UIHFactory getStreamUIHFactory();
71+
public abstract ListUIHFactory getChannelUIHFactory();
72+
public abstract ListUIHFactory getPlaylistUIHFactory();
73+
public abstract SearchQIHFactory getSearchQIHFactory();
7674

7775

7876
////////////////////////////////////////////
7977
// Extractor
8078
////////////////////////////////////////////
81-
public abstract SearchEngine getSearchEngine();
82-
public abstract SearchExtractor getSearchExtractor(SearchQueryUrlHandler queryHandler, String contentCountry);
79+
public abstract SearchExtractor getSearchExtractor(SearchQIHFactory queryHandler, String contentCountry);
8380
public abstract SuggestionExtractor getSuggestionExtractor();
8481
public abstract SubscriptionExtractor getSubscriptionExtractor();
8582
public abstract KioskList getKioskList() throws ExtractionException;
8683

87-
public abstract ChannelExtractor getChannelExtractor(ListUrlIdHandler urlIdHandler) throws ExtractionException;
88-
public abstract PlaylistExtractor getPlaylistExtractor(ListUrlIdHandler urlIdHandler) throws ExtractionException;
89-
public abstract StreamExtractor getStreamExtractor(UrlIdHandler urlIdHandler) throws ExtractionException;
84+
public abstract ChannelExtractor getChannelExtractor(ListUIHFactory urlIdHandler) throws ExtractionException;
85+
public abstract PlaylistExtractor getPlaylistExtractor(ListUIHFactory urlIdHandler) throws ExtractionException;
86+
public abstract StreamExtractor getStreamExtractor(UIHFactory UIHFactory) throws ExtractionException;
9087

9188
public SearchExtractor getSearchExtractor(String query, List<String> contentFilter, String sortFilter, String contentCountry) throws ExtractionException {
92-
return getSearchExtractor(getSearchQueryHandler().setQuery(query, contentFilter, sortFilter), contentCountry);
89+
return getSearchExtractor(getSearchQIHFactory().setQuery(query, contentFilter, sortFilter), contentCountry);
9390
}
9491

9592
public ChannelExtractor getChannelExtractor(String id, List<String> contentFilter, String sortFilter) throws ExtractionException {
96-
return getChannelExtractor(getChannelUrlIdHandler().setQuery(id, contentFilter, sortFilter));
93+
return getChannelExtractor(getChannelUIHFactory().setQuery(id, contentFilter, sortFilter));
9794
}
9895

9996
public PlaylistExtractor getPlaylistExtractor(String id, List<String> contentFilter, String sortFilter) throws ExtractionException {
100-
return getPlaylistExtractor(getPlaylistUrlIdHandler().setQuery(id, contentFilter, sortFilter));
97+
return getPlaylistExtractor(getPlaylistUIHFactory().setQuery(id, contentFilter, sortFilter));
10198
}
10299

103100
public SearchExtractor getSearchExtractor(String query, String contentCountry) throws ExtractionException {
104-
return getSearchExtractor(getSearchQueryHandler().setQuery(query), contentCountry);
101+
return getSearchExtractor(getSearchQIHFactory().setQuery(query), contentCountry);
105102
}
106103

107104
public ChannelExtractor getChannelExtractor(String url) throws ExtractionException {
108-
return getChannelExtractor(getChannelUrlIdHandler().setUrl(url));
105+
return getChannelExtractor(getChannelUIHFactory().setUrl(url));
109106
}
110107

111108
public PlaylistExtractor getPlaylistExtractor(String url) throws ExtractionException {
112-
return getPlaylistExtractor(getPlaylistUrlIdHandler().setUrl(url));
109+
return getPlaylistExtractor(getPlaylistUIHFactory().setUrl(url));
113110
}
114111

115112
public StreamExtractor getStreamExtractor(String url) throws ExtractionException {
116-
return getStreamExtractor(getStreamUrlIdHandler().setUrl(url));
113+
return getStreamExtractor(getStreamUIHFactory().setUrl(url));
117114
}
118115

119116

@@ -122,9 +119,9 @@ public StreamExtractor getStreamExtractor(String url) throws ExtractionException
122119
* figure out where the link is pointing to (a channel, video, playlist, etc.)
123120
*/
124121
public final LinkType getLinkTypeByUrl(String url) throws ParsingException {
125-
UrlIdHandler sH = getStreamUrlIdHandler();
126-
UrlIdHandler cH = getChannelUrlIdHandler();
127-
UrlIdHandler pH = getPlaylistUrlIdHandler();
122+
UIHFactory sH = getStreamUIHFactory();
123+
UIHFactory cH = getChannelUIHFactory();
124+
UIHFactory pH = getPlaylistUIHFactory();
128125

129126
if (sH.acceptUrl(url)) {
130127
return LinkType.STREAM;

extractor/src/main/java/org/schabi/newpipe/extractor/UrlIdHandler.java renamed to extractor/src/main/java/org/schabi/newpipe/extractor/UIHFactory.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package org.schabi.newpipe.extractor;
22

3-
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
43
import org.schabi.newpipe.extractor.exceptions.ParsingException;
54

65
/*
76
* Created by Christian Schabesberger on 26.07.16.
87
*
98
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
10-
* UrlIdHandler.java is part of NewPipe.
9+
* UIHFactory.java is part of NewPipe.
1110
*
1211
* NewPipe is free software: you can redistribute it and/or modify
1312
* it under the terms of the GNU General Public License as published by
@@ -23,7 +22,7 @@
2322
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
2423
*/
2524

26-
public abstract class UrlIdHandler {
25+
public abstract class UIHFactory {
2726

2827
protected String id = "";
2928
protected String originalUrl = "";
@@ -33,14 +32,14 @@ public abstract class UrlIdHandler {
3332
public abstract boolean onAcceptUrl(final String url) throws ParsingException;
3433

3534

36-
public UrlIdHandler setUrl(String url) throws ParsingException {
35+
public UIHFactory setUrl(String url) throws ParsingException {
3736
if(url == null) throw new IllegalArgumentException("url can not be null");
3837
originalUrl = url;
3938
id = onGetIdFromUrl(url);
4039
return this;
4140
}
4241

43-
public UrlIdHandler setId(String id) throws ParsingException {
42+
public UIHFactory setId(String id) throws ParsingException {
4443
if(id == null) throw new IllegalArgumentException("id can not be null");
4544
this.id = id;
4645
if(!acceptUrl(getUrl())) {

extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelExtractor.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
package org.schabi.newpipe.extractor.channel;
22

33
import org.schabi.newpipe.extractor.ListExtractor;
4-
import org.schabi.newpipe.extractor.ListUrlIdHandler;
4+
import org.schabi.newpipe.extractor.ListUIHFactory;
55
import org.schabi.newpipe.extractor.StreamingService;
6-
import org.schabi.newpipe.extractor.UrlIdHandler;
7-
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
86
import org.schabi.newpipe.extractor.exceptions.ParsingException;
97
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
108

11-
import javax.annotation.Nonnull;
12-
139
/*
1410
* Created by Christian Schabesberger on 25.07.16.
1511
*
@@ -32,7 +28,7 @@
3228

3329
public abstract class ChannelExtractor extends ListExtractor<StreamInfoItem> {
3430

35-
public ChannelExtractor(StreamingService service, ListUrlIdHandler urlIdHandler) {
31+
public ChannelExtractor(StreamingService service, ListUIHFactory urlIdHandler) {
3632
super(service, urlIdHandler);
3733
}
3834

extractor/src/main/java/org/schabi/newpipe/extractor/channel/ChannelInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
44
import org.schabi.newpipe.extractor.ListInfo;
5-
import org.schabi.newpipe.extractor.ListUrlIdHandler;
5+
import org.schabi.newpipe.extractor.ListUIHFactory;
66
import org.schabi.newpipe.extractor.NewPipe;
77
import org.schabi.newpipe.extractor.StreamingService;
88
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
@@ -34,7 +34,7 @@
3434

3535
public class ChannelInfo extends ListInfo<StreamInfoItem> {
3636

37-
public ChannelInfo(int serviceId, ListUrlIdHandler urlIdHandler, String name) throws ParsingException {
37+
public ChannelInfo(int serviceId, ListUIHFactory urlIdHandler, String name) throws ParsingException {
3838
super(serviceId, urlIdHandler, name);
3939
}
4040

@@ -55,7 +55,7 @@ public static InfoItemsPage<StreamInfoItem> getMoreItems(StreamingService servic
5555
public static ChannelInfo getInfo(ChannelExtractor extractor) throws IOException, ExtractionException {
5656

5757
ChannelInfo info = new ChannelInfo(extractor.getServiceId(),
58-
extractor.getUrlIdHandler(),
58+
extractor.getUIHFactory(),
5959
extractor.getName());
6060

6161

extractor/src/main/java/org/schabi/newpipe/extractor/kiosk/KioskExtractor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
*/
2222

2323
import org.schabi.newpipe.extractor.ListExtractor;
24-
import org.schabi.newpipe.extractor.ListUrlIdHandler;
24+
import org.schabi.newpipe.extractor.ListUIHFactory;
2525
import org.schabi.newpipe.extractor.StreamingService;
26-
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
2726
import org.schabi.newpipe.extractor.exceptions.ParsingException;
2827
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
2928

@@ -34,7 +33,7 @@ public abstract class KioskExtractor extends ListExtractor<StreamInfoItem> {
3433
private final String id;
3534

3635
public KioskExtractor(StreamingService streamingService,
37-
ListUrlIdHandler urlIdHandler,
36+
ListUIHFactory urlIdHandler,
3837
String kioskId) {
3938
super(streamingService, urlIdHandler);
4039
this.id = kioskId;

0 commit comments

Comments
 (0)