public static Token tokenForUrl(String url,String text){
  if (url == null) {
    return null;
  }
  Video video=Video.matchURL(url,text);
  if (video != null) {
    return video;
  }
  YouTubeVideo ytVideo=YouTubeVideo.matchURL(url,text);
  if (ytVideo != null) {
    return ytVideo;
  }
  Photo photo=Photo.matchURL(url,text);
  if (photo != null) {
    return photo;
  }
  FlickrPhoto flickrPhoto=FlickrPhoto.matchURL(url,text);
  if (flickrPhoto != null) {
    return flickrPhoto;
  }
  return new Link(url,text);
}

public static Token tokenForUrl ( String url , String text ) { if ( url == null ) { return null ; } Video video = Video . matchURL ( url , text ) ; if ( video != null ) { return video ; } YouTubeVideo ytVideo = YouTubeVideo . matchURL ( url , text ) ; if ( ytVideo != null ) { return ytVideo ; } Photo photo = Photo . matchURL ( url , text ) ; if ( photo != null ) { return photo ; } FlickrPhoto flickrPhoto = FlickrPhoto . matchURL ( url , text ) ; if ( flickrPhoto != null ) { return flickrPhoto ; } return new Link ( url , text ) ; }
get a the appropriate token for a given url
