public AutomagicMadvocConfigurator() { actionClassSuffix = "Action"; classScanner = new ClassScanner(); classScanner.detectEntriesMode(true); classScanner.scanDefaultClasspath(); registerAsConsumer(classScanner); }
/** * Loads properties from classpath file(s). Properties are specified using wildcards. */ public static Properties loadFromClasspath(final Properties p, String... rootTemplate) { ClassScanner scanner = new ClassScanner() { @Override protected void onEntry(EntryData entryData) throws IOException { p.load(entryData.openInputStream()); } }; scanner.setIncludeResources(true); scanner.setIgnoreException(true); scanner.setExcludeAllEntries(true); scanner.setIncludedEntries(rootTemplate); scanner.scanDefaultClasspath(); return p; }
/** * Configures {@link jodd.petite.PetiteContainer} with specified class path. */ public void configure() { long elapsed = System.currentTimeMillis(); final ClassScanner classScanner = new ClassScanner(); classScanner.detectEntriesMode(true); classScanner.scanDefaultClasspath(); classScannerConsumers.accept(classScanner); registerAsConsumer(classScanner); try { classScanner.start(); } catch (Exception ex) { throw new PetiteException("Scan classpath error", ex); } elapsed = System.currentTimeMillis() - elapsed; log.info("Petite configured in " + elapsed + " ms. Total beans: " + container.beansCount()); }
/** * Configures {@link DbEntityManager} with specified class path. */ public void configure() { long elapsed = System.currentTimeMillis(); final ClassScanner classScanner = new ClassScanner(); classScanner.detectEntriesMode(true); classScanner.scanDefaultClasspath(); classScannerConsumers.accept(classScanner); registerAsConsumer(classScanner); try { classScanner.start(); } catch (Exception ex) { throw new DbOomException("Scan classpath error", ex); } elapsed = System.currentTimeMillis() - elapsed; if (log.isInfoEnabled()) { log.info("DbEntityManager configured in " + elapsed + "ms. Total entities: " + dbEntityManager.getTotalNames()); } }
/** * Loads properties from classpath file(s). Properties are specified using wildcards. */ public static Properties loadFromClasspath(final Properties p, final String... rootTemplate) { ClassScanner.create() .registerEntryConsumer(entryData -> UncheckedException.runAndWrapException(() -> p.load(entryData.openInputStream()))) .includeResources(true) .ignoreException(true) .excludeAllEntries(true) .includeEntries(rootTemplate) .scanDefaultClasspath(); return p; }
.includeJars(includedJars.toArray(new String[0])) .ignoreException(ignoreExceptions) .scanDefaultClasspath();
/** * Loads props and properties from the classpath. */ public Props loadFromClasspath(final String... patterns) { ClassScanner.create() .registerEntryConsumer(entryData -> { String usedEncoding = JoddCore.encoding; if (StringUtil.endsWithIgnoreCase(entryData.name(), ".properties")) { usedEncoding = StringPool.ISO_8859_1; } final String encoding = usedEncoding; UncheckedException.runAndWrapException(() -> load(entryData.openInputStream(), encoding)); }) .includeResources(true) .ignoreException(true) .excludeCommonJars() .excludeAllEntries(true) .includeEntries(patterns) .scanDefaultClasspath() .start(); return this; }
/** * Configures {@link jodd.petite.PetiteContainer} with specified class path. */ public void configure() { long elapsed = System.currentTimeMillis(); final ClassScanner classScanner = new ClassScanner(); classScanner.detectEntriesMode(true); classScanner.scanDefaultClasspath(); classScannerConsumers.accept(classScanner); registerAsConsumer(classScanner); try { classScanner.start(); } catch (Exception ex) { throw new PetiteException("Scan classpath error", ex); } elapsed = System.currentTimeMillis() - elapsed; log.info("Petite configured in " + elapsed + " ms. Total beans: " + container.beansCount()); }
/** * Loads properties from classpath file(s). Properties are specified using wildcards. */ public static Properties loadFromClasspath(final Properties p, final String... rootTemplate) { ClassScanner.create() .registerEntryConsumer(entryData -> UncheckedException.runAndWrapException(() -> p.load(entryData.openInputStream()))) .includeResources(true) .ignoreException(true) .excludeAllEntries(true) .includeEntries(rootTemplate) .scanDefaultClasspath(); return p; }
/** * Configures {@link DbEntityManager} with specified class path. */ public void configure() { long elapsed = System.currentTimeMillis(); final ClassScanner classScanner = new ClassScanner(); classScanner.detectEntriesMode(true); classScanner.scanDefaultClasspath(); classScannerConsumers.accept(classScanner); registerAsConsumer(classScanner); try { classScanner.start(); } catch (Exception ex) { throw new DbOomException("Scan classpath error", ex); } elapsed = System.currentTimeMillis() - elapsed; if (log.isInfoEnabled()) { log.info("DbEntityManager configured in " + elapsed + "ms. Total entities: " + dbEntityManager.getTotalNames()); } }
.includeJars(includedJars.toArray(new String[0])) .ignoreException(ignoreExceptions) .scanDefaultClasspath();
/** * Loads props and properties from the classpath. */ public Props loadFromClasspath(final String... patterns) { ClassScanner.create() .registerEntryConsumer(entryData -> { String usedEncoding = JoddCore.encoding; if (StringUtil.endsWithIgnoreCase(entryData.name(), ".properties")) { usedEncoding = StringPool.ISO_8859_1; } final String encoding = usedEncoding; UncheckedException.runAndWrapException(() -> load(entryData.openInputStream(), encoding)); }) .includeResources(true) .ignoreException(true) .excludeCommonJars() .excludeAllEntries(true) .includeEntries(patterns) .scanDefaultClasspath() .start(); return this; }