2 * Copyright (c) 2015-2019. Developed by Hedgecode.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.hedgecode.xml.xspf;
19 import java.util.List;
21 import org.hedgecode.xml.xspf.bind.TrackBinder;
23 import static org.hedgecode.xml.xspf.XSPFConstants.Format;
28 * @author Dmitry Samoshin aka gotty
30 public final class PlaylistFactory {
32 public static Playlist createPlaylist(Format format) {
33 return new XSPFPlaylist(format);
36 public static Track createTrack() {
37 return new XSPFTrack();
40 public static Track createTrack(TrackBinder trackBinder) {
41 XSPFTrack track = new XSPFTrack();
43 new XMLBindTrack(trackBinder)
48 public static void bindTrack(Track track, TrackBinder trackBinder) {
49 if (track instanceof XSPFTrack)
50 ((XSPFTrack)track).bind(
51 new XMLBindTrack(trackBinder)
55 public static Attribution createAttribution() {
56 Attribution attribution = new XSPFAttribution();
60 public static Attribution createAttribution(String identifier, String location) {
61 Attribution attribution = new XSPFAttribution();
62 attribution.add(identifier, location);
66 public static Link createLink(String rel, String content) {
67 return new XSPFLink(rel, content);
70 public static Meta createMeta(String rel, String content) {
71 return new XSPFMeta(rel, content);
74 public static Extension createExtension(String application, List<Object> content) {
75 return new XSPFExtension(application, content);