public boolean isWhitelisted(final MetaClass type) { if (whitelist.isEmpty()) { return true; } final SimplePackageFilter implicitFilter = new SimplePackageFilter(Arrays.asList(implicitWhitelist)); final SimplePackageFilter whitelistFilter = new SimplePackageFilter(whitelist); final String fullName = type.getFullyQualifiedName(); return implicitFilter.apply(fullName) || whitelistFilter.apply(fullName); }
public boolean isWhitelisted(final MetaClass type) { if (whitelist.isEmpty()) { return true; } final SimplePackageFilter implicitFilter = new SimplePackageFilter(Arrays.asList(implicitWhitelist)); final SimplePackageFilter whitelistFilter = new SimplePackageFilter(whitelist); final String fullName = type.getFullyQualifiedName(); return implicitFilter.apply(fullName) || whitelistFilter.apply(fullName); }
public boolean isBlacklisted(final MetaClass type) { final SimplePackageFilter blacklistFilter = new SimplePackageFilter(blacklist); final String fullName = type.getFullyQualifiedName(); return blacklistFilter.apply(fullName); }
public boolean isBlacklisted(final MetaClass type) { final SimplePackageFilter blacklistFilter = new SimplePackageFilter(blacklist); final String fullName = type.getFullyQualifiedName(); return blacklistFilter.apply(fullName); }
private static void addConfiguredNonBindableTypes(final Set<MetaClass> nonbindableClasses, String value) { final Set<String> patterns = new LinkedHashSet<>(); for (final String s : value.split(" ")) { final String singleValue = s.trim(); if (singleValue.endsWith("*")) { patterns.add(singleValue); } else { try { nonbindableClasses.add(MetaClassFactory.get(singleValue)); } catch (final Exception e) { throw new RuntimeException("Could not find class defined in ErraiApp.properties as nonbindable type: " + s); } } } if (!patterns.isEmpty()) { final SimplePackageFilter filter = new SimplePackageFilter(patterns); MetaClassFactory .getAllCachedClasses() .stream() .filter(mc -> filter.apply(mc.getFullyQualifiedName())) .collect(toCollection(() -> nonbindableClasses)); } }
private static void addNonSerializableTypes(final Set<MetaClass> nonportableClasses, final String value) { final Set<String> patterns = new LinkedHashSet<>(); for (final String s : value.split(" ")) { final String singleValue = s.trim(); if (singleValue.endsWith("*")) { patterns.add(singleValue); } else { try { nonportableClasses.add(MetaClassFactory.get(singleValue)); } catch (final Exception e) { throw new RuntimeException("could not find class defined in ErraiApp.properties as nonserializable: " + s, e); } } } if (!patterns.isEmpty()) { final SimplePackageFilter filter = new SimplePackageFilter(patterns); MetaClassFactory .getAllCachedClasses() .stream() .filter(mc -> filter.apply(mc.getFullyQualifiedName())) .collect(toCollection(() -> nonportableClasses)); } }
private static void addConfiguredNonBindableTypes(final Set<MetaClass> nonbindableClasses, String value) { final Set<String> patterns = new LinkedHashSet<>(); for (final String s : value.split(" ")) { final String singleValue = s.trim(); if (singleValue.endsWith("*")) { patterns.add(singleValue); } else { try { nonbindableClasses.add(MetaClassFactory.get(singleValue)); } catch (final Exception e) { throw new RuntimeException("Could not find class defined in ErraiApp.properties as nonbindable type: " + s); } } } if (!patterns.isEmpty()) { final SimplePackageFilter filter = new SimplePackageFilter(patterns); MetaClassFactory .getAllCachedClasses() .stream() .filter(mc -> filter.apply(mc.getFullyQualifiedName())) .collect(toCollection(() -> nonbindableClasses)); } }
private static void addConfiguredBindableTypes(final Set<MetaClass> bindableClasses, String value) { final Set<String> patterns = new LinkedHashSet<>(); for (final String s : value.split(" ")) { final String singleValue = s.trim(); if (singleValue.endsWith("*")) { patterns.add(singleValue); } else { try { bindableClasses.add(MetaClassFactory.get(singleValue)); } catch (final Exception e) { throw new RuntimeException("Could not find class defined in ErraiApp.properties as bindable type: " + s); } } } if (!patterns.isEmpty()) { final SimplePackageFilter filter = new SimplePackageFilter(patterns); MetaClassFactory .getAllCachedClasses() .stream() .filter(mc -> filter.apply(mc.getFullyQualifiedName()) && validateWildcard(mc)) .collect(toCollection(() -> bindableClasses)); } }
private static void addNonSerializableTypes(final Set<MetaClass> nonportableClasses, final String value) { final Set<String> patterns = new LinkedHashSet<>(); for (final String s : value.split(" ")) { final String singleValue = s.trim(); if (singleValue.endsWith("*")) { patterns.add(singleValue); } else { try { nonportableClasses.add(MetaClassFactory.get(singleValue)); } catch (final Exception e) { throw new RuntimeException("could not find class defined in ErraiApp.properties as nonserializable: " + s, e); } } } if (!patterns.isEmpty()) { final SimplePackageFilter filter = new SimplePackageFilter(patterns); MetaClassFactory .getAllCachedClasses() .stream() .filter(mc -> filter.apply(mc.getFullyQualifiedName())) .collect(toCollection(() -> nonportableClasses)); } }
private static void addConfiguredBindableTypes(final Set<MetaClass> bindableClasses, String value) { final Set<String> patterns = new LinkedHashSet<>(); for (final String s : value.split(" ")) { final String singleValue = s.trim(); if (singleValue.endsWith("*")) { patterns.add(singleValue); } else { try { bindableClasses.add(MetaClassFactory.get(singleValue)); } catch (final Exception e) { throw new RuntimeException("Could not find class defined in ErraiApp.properties as bindable type: " + s); } } } if (!patterns.isEmpty()) { final SimplePackageFilter filter = new SimplePackageFilter(patterns); MetaClassFactory .getAllCachedClasses() .stream() .filter(mc -> filter.apply(mc.getFullyQualifiedName()) && validateWildcard(mc)) .collect(toCollection(() -> bindableClasses)); } }
.getAllCachedClasses() .stream() .filter(mc -> filter.apply(mc.getFullyQualifiedName()) && validateWildcardSerializable(mc)) .collect(toCollection(() -> exposedClasses));
.getAllCachedClasses() .stream() .filter(mc -> filter.apply(mc.getFullyQualifiedName()) && validateWildcardSerializable(mc)) .collect(toCollection(() -> exposedClasses));
final SimplePackageFilter filter = new SimplePackageFilter(PropertiesUtil.getPropertyValues(BLACKLIST_PROPERTY, " ")); for (final Class<?> bean : beans) { if (!filter.apply(bean.getName())) { filteredBeans.add(bean);