2 * Copyright (c) 2015. 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.bind;
19 import org.hedgecode.xml.xspf.rng.Track;
20 import org.hedgecode.xml.xspf.xsd.TrackType;
22 import static org.hedgecode.xml.xspf.XSPFConstants.Format;
25 * Playlist/Track Binder Factory.
27 * @author Dmitry Samoshin aka gotty
29 public final class BinderFactory {
31 public static PlaylistBinder createPlaylistBinder() {
32 return getDefaultPlaylistBinder();
35 public static PlaylistBinder createPlaylistBinder(Format format) {
38 return new RNGPlaylistBinder();
40 return new XSDPlaylistBinder();
42 return getDefaultPlaylistBinder();
46 public static TrackBinder createTrackBinder() {
47 return getDefaultTrackBinder();
50 public static TrackBinder createTrackBinder(Format format) {
53 return new RNGTrackBinder();
55 return new XSDTrackBinder();
57 return getDefaultTrackBinder();
61 public static TrackBinder createTrackBinder(Track track) {
62 return new RNGTrackBinder(track);
65 public static TrackBinder createTrackBinder(TrackType trackType) {
66 return new XSDTrackBinder(trackType);
69 private static PlaylistBinder getDefaultPlaylistBinder() {
70 return new RNGPlaylistBinder();
73 private static TrackBinder getDefaultTrackBinder() {
74 return new RNGTrackBinder();