
com.rometools.rome.feed.impl.ConfigurableClassLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rome Show documentation
Show all versions of rome Show documentation
All Roads Lead to ROME. ROME is a set of Atom/RSS Java utilities that make it
easy to work in Java with most syndication formats. Today it accepts all flavors of RSS
(0.90, 0.91, 0.92, 0.93, 0.94, 1.0 and 2.0), Atom 0.3 and Atom 1.0 feeds. Rome includes
a set of parsers and generators for the various flavors of feeds, as well as converters
to convert from one format to another. The parsers can give you back Java objects that
are either specific for the format you want to work with, or a generic normalized
SyndFeed object that lets you work on with the data without bothering about the
underlying format.
package com.rometools.rome.feed.impl;
/**
* This class addresses some ClassLoader problems in OSGi environments. If you have ClassLoader
* problems, simply override the default ClassLoader by calling the
* {@link #setClassLoader(ClassLoader)} method before calling any ROME code. Unfortunately I don't
* know whether this works because I have absolutely no experience with OSGi.
*
* @author Patrick Gotthard
*
*/
public enum ConfigurableClassLoader {
INSTANCE;
private ClassLoader classLoader;
/**
* Get the configured ClassLoader. Returns
*
* @return The configured ClassLoader. Returns the ClassLoader of this enum when the ClassLoader
* was not overridden.
*/
public ClassLoader getClassLoader() {
if (classLoader == null) {
classLoader = ConfigurableClassLoader.class.getClassLoader();
}
return classLoader;
}
/**
* Overrides the default ClassLoader (the ClassLoader of this enum).
*
* @param classLoader The ClassLoader to set.
*/
public void setClassLoader(final ClassLoader classLoader) {
this.classLoader = classLoader;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy