@SingletonDefault(implFor=StringService.class) public class JreStringService implements StringService { private static final Charset UTF8; static { UTF8 = Charset.forName("UTF8"); } @Override public boolean notNullOrEmpty(String str) { return str != null && str.length() != 0; } @Override public String notNullOrEmpty(String str, String dflt) { return str == null || str.length() == 0 ? dflt : str; } @Override public byte[] toBytes(String str) { return str.getBytes(UTF8); } }
@SingletonDefault(implFor=ModelCache.class) public class AbstractModelCache implements ModelCache{
@SingletonDefault(implFor=ReflectionService.class) public class ReflectionServiceDefault implements ReflectionService{
@SingletonDefault(implFor=SourceService.class) public class SourceServiceDefault implements SourceService {
@GwtDevPlatform @SingletonDefault(implFor=ReflectionService.class) public class GwtDevReflectionService extends ReflectionServiceDefault { @Override public Package getPackage(@NotNull Object o) { Class<?> cls = o.getClass(); // Gwt-dev can't use cls.getPackage(), so we force a classloader lookup return getPackage(cls.getCanonicalName().replace("."+cls.getSimpleName(), ""), cls.getClassLoader()); } }
@SingletonDefault(implFor = MagicClassInjector.class) public class MagicClassInjector implements MagicMethodGenerator {
@SingletonDefault(implFor = MvnService.class) public class MvnServiceDefault implements MvnService {
@SingletonDefault(implFor=FileService.class) public class FileServiceImpl implements FileService {
@JrePlatform @GwtDevPlatform @SingletonDefault(implFor=CollectionService.class) public class CollectionServiceJre extends CollectionServiceDefault{ }
@JrePlatform @SingletonDefault(implFor=ConcurrencyService.class) public class ConcurrencyServiceJre extends ConcurrencyServiceAbstract{
@SingletonDefault(implFor=IOService.class) public class IOServiceDefault extends AbstractIOService <URLConnection> {
@SingletonDefault(implFor=ModelService.class) public class ModelServiceJre extends AbstractModelService {
@GwtDevPlatform @JrePlatform @AndroidPlatform @SingletonDefault(implFor=CollectionService.class) public class CollectionServiceDefault implements CollectionService{