@Test(expected = IllegalStateException.class) public void checkMultiExtension1() throws Exception { AbstractConfig.checkMultiExtension(Greeting.class, "hello", "default,world"); }
protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (value != null && value.length() > 0) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX)) { v = v.substring(1); } if (Constants.DEFAULT_KEY.equals(v)) { continue; } if (!ExtensionLoader.getExtensionLoader(type).hasExtension(v)) { throw new IllegalStateException("No such extension " + v + " for " + property + "/" + type.getName()); } } } }
AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (value != null && value.length() > 0) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX)) { v = v.substring(1); } if (Constants.DEFAULT_KEY.equals(v)) { continue; } if (!ExtensionLoader.getExtensionLoader(type).hasExtension(v)) { throw new IllegalStateException("No such extension " + v + " for " + property + "/" + type.getName()); } } } } }
AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (value != null && value.length() > 0) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX)) { v = v.substring(1); } if (Constants.DEFAULT_KEY.equals(v)) { continue; } if (!ExtensionLoader.getExtensionLoader(type).hasExtension(v)) { throw new IllegalStateException("No such extension " + v + " for " + property + "/" + type.getName()); } } } }  }
AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (value != null && value.length() > 0) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX)) { v = v.substring(1); } if (Constants.DEFAULT_KEY.equals(v)) { continue; } if (!ExtensionLoader.getExtensionLoader(type).hasExtension(v)) { throw new IllegalStateException("No such extension " + v + " for " + property + "/" + type.getName()); } } } }  @Parameter(excluded = true) String getId(); void setId(String id); @Override String toString(); }
AbstractConfig implements Serializable { protected static void checkMultiExtension(Class<?> type, String property, String value) { checkMultiName(property, value); if (value != null && value.length() > 0) { String[] values = value.split("\\s*[,]+\\s*"); for (String v : values) { if (v.startsWith(Constants.REMOVE_VALUE_PREFIX)) { v = v.substring(1); } if (Constants.DEFAULT_KEY.equals(v)) { continue; } if (!ExtensionLoader.getExtensionLoader(type).hasExtension(v)) { throw new IllegalStateException("No such extension " + v + " for " + property + "/" + type.getName()); } } } }  @Parameter(excluded = true) String getId(); void setId(String id); @Override String toString();  }