/** * Parses class name that matches madvoc-related names. */ @Override protected void onEntry(EntryData entryData) { String entryName = entryData.getName(); if (entryName.endsWith(actionClassSuffix) == true) { try { onActionClass(entryName); } catch (ClassNotFoundException cnfex) { throw new MadvocException("Unable to load Madvoc action class: " + entryName, cnfex); } } else if (entryName.endsWith(resultClassSuffix) == true) { try { onResultClass(entryName); } catch (ClassNotFoundException cnfex) { throw new MadvocException("Unable to load Madvoc result class: " + entryName, cnfex); } } }
/** * Scans all classes and registers only those annotated with {@link jodd.petite.meta.PetiteBean}. * Because of performance purposes, classes are not dynamically loaded; instead, their * file content is examined. */ @Override protected void onEntry(EntryData entryData) { String entryName = entryData.getName(); InputStream inputStream = entryData.openInputStream(); if (isTypeSignatureInUse(inputStream, petiteBeanAnnotationBytes) == false) { return; } Class<?> beanClass; try { beanClass = loadClass(entryName); } catch (ClassNotFoundException cnfex) { throw new PetiteException("Unable to load class: " + cnfex, cnfex); } PetiteBean petiteBean = beanClass.getAnnotation(PetiteBean.class); if (petiteBean == null) { return; } container.registerBean(beanClass); }
/** * Scans all classes and registers only those annotated with {@link jodd.petite.meta.PetiteBean}. * Because of performance purposes, classes are not dynamically loaded; instead, their * file content is examined. */ @Override protected void onEntry(EntryData entryData) { String entryName = entryData.getName(); InputStream inputStream = entryData.openInputStream(); if (isTypeSignatureInUse(inputStream, dbTableAnnotationBytes) == false) { return; } Class<?> beanClass; try { beanClass = loadClass(entryName); } catch (ClassNotFoundException cnfex) { throw new DbOomException("Unable to load class: " + entryName, cnfex); } DbTable dbTable = beanClass.getAnnotation(DbTable.class); if (dbTable == null) { return; } if (registerAsEntities == true) { dbOomManager.registerEntity(beanClass); } else { dbOomManager.registerType(beanClass); } }
/** * If entry name is {@link #acceptEntry(String) accepted} invokes {@link #onEntry(EntryData)} a callback}. */ protected void scanEntry(EntryData entryData) { if (!acceptEntry(entryData.getName())) { return; } try { onEntry(entryData); } catch (Exception ex) { throw new FindFileException("Scan entry error: " + entryData, ex); } }