/** * Returns <code>true</code> if class or resource name matches * at least one package rule from the list. */ protected boolean isMatchingRules(String name, String... rules) { for (String rule : rules) { if (Wildcard.equalsOrMatch(name, rule)) { return true; } } return false; }
/** * Returns <code>true</code> if class or resource name matches * at least one package rule from the list. */ protected boolean isMatchingRules(final String name, final String... rules) { for (String rule : rules) { if (Wildcard.equalsOrMatch(name, rule)) { return true; } } return false; }
private void checkClassName(final List<String> classnameWhitelist, final String className) { if (classnameWhitelist == null) { return; } classnameWhitelist.forEach(pattern -> { if (!Wildcard.equalsOrMatch(className, pattern)) { throw new JsonException("Class can't be loaded as it is not whitelisted: " + className); } }); }
/** * Returns all the profiles that define certain prop's key name. * Key name is given as a wildcard, or it can be matched fully. */ public String[] getProfilesFor(final String propKeyNameWildcard) { HashSet<String> profiles = new HashSet<>(); profile: for (Map.Entry<String, Map<String, PropsEntry>> entries : data.profileProperties.entrySet()) { String profileName = entries.getKey(); Map<String, PropsEntry> value = entries.getValue(); for (String propKeyName : value.keySet()) { if (Wildcard.equalsOrMatch(propKeyName, propKeyNameWildcard)) { profiles.add(profileName); continue profile; } } } return profiles.toArray(new String[0]); }
/** * Returns <code>true</code> if class or resource name matches * at least one package rule from the list. */ protected boolean isMatchingRules(final String name, final String... rules) { for (String rule : rules) { if (Wildcard.equalsOrMatch(name, rule)) { return true; } } return false; }
/** * Returns all the profiles that define certain prop's key name. * Key name is given as a wildcard, or it can be matched fully. */ public String[] getProfilesFor(final String propKeyNameWildcard) { HashSet<String> profiles = new HashSet<>(); profile: for (Map.Entry<String, Map<String, PropsEntry>> entries : data.profileProperties.entrySet()) { String profileName = entries.getKey(); Map<String, PropsEntry> value = entries.getValue(); for (String propKeyName : value.keySet()) { if (Wildcard.equalsOrMatch(propKeyName, propKeyNameWildcard)) { profiles.add(profileName); continue profile; } } } return profiles.toArray(new String[0]); }