Пример #1
0
 /** returns a list of all available codec names */
 public static Set<String> availableCodecs() {
   if (loader == null) {
     throw new IllegalStateException(
         "You called Codec.availableCodecs() before all Codecs could be initialized. "
             + "This likely happens if you call it from a Codec's ctor.");
   }
   return loader.availableServices();
 }
Пример #2
0
 /** looks up a codec by name */
 public static Codec forName(String name) {
   if (loader == null) {
     throw new IllegalStateException(
         "You called Codec.forName() before all Codecs could be initialized. "
             + "This likely happens if you call it from a Codec's ctor.");
   }
   return loader.lookup(name);
 }
Пример #3
0
 /** returns a list of all available codec names */
 public static Set<String> availableCodecs() {
   return loader.availableServices();
 }
Пример #4
0
 /** looks up a codec by name */
 public static Codec forName(String name) {
   return loader.lookup(name);
 }
Пример #5
0
 public Codec(String name) {
   NamedSPILoader.checkServiceName(name);
   this.name = name;
 }
Пример #6
0
 /**
  * Reloads the codec list from the given {@link ClassLoader}. Changes to the codecs are visible
  * after the method ends, all iterators ({@link #availableCodecs()},...) stay consistent.
  *
  * <p><b>NOTE:</b> Only new codecs are added, existing ones are never removed or replaced.
  *
  * <p><em>This method is expensive and should only be called for discovery of new codecs on the
  * given classpath/classloader!</em>
  */
 public static void reloadCodecs(ClassLoader classloader) {
   loader.reload(classloader);
 }