public static Iterable<CssRule> cssRulesOf(FreudSource source) {
if (File.class.equals(source.getType())) {
return new SubTypeAnalysedObjects<File, CssRule>(new CssRulesJdomFromFileCreator(), source.getSources());
}
if (URL.class.equals(source.getType())) {
return new SubTypeAnalysedObjects<URL, CssRule>(new CssRulesJdomFromUrlCreator(), source.getSources());
}
if (String.class.equals(source.getType())) {
return new SubTypeAnalysedObjects<String, CssRule>(new CssRulesJdomFromStringCreator(), source.getSources());
}
throw new UnsupportedOperationException("Unsupported conversion " + source.getType() + " to Css");