public static boolean isEmpty(String str) { return !isNotEmpty(str); } }
public static boolean isEmpty(String str) { return !isNotEmpty(str); } }
public static boolean isEmpty(String o) { return !isNotEmpty(o); } }
public static boolean isEmpty(Long o) { return !isNotEmpty(o); }
public static boolean isEmpty(Integer o) { return !isNotEmpty(o); }
if (VerifyUtils.isNotEmpty(cookie.getComment())) { sb.append(";Comment=").append(cookie.getComment()); if (VerifyUtils.isNotEmpty(cookie.getDomain())) { sb.append(";Domain=").append(cookie.getDomain());
if (VerifyUtils.isNotEmpty(cookie.getComment())) { sb.append(";Comment=").append(cookie.getComment()); if (VerifyUtils.isNotEmpty(cookie.getDomain())) { sb.append(";Domain=").append(cookie.getDomain());
private void fieldInject(AnnotationBeanDefinition beanDefinition, final Object object) { for (Field field : beanDefinition.getInjectFields()) { field.setAccessible(true); Class<?> clazz = field.getType(); String id = field.getAnnotation(Inject.class).value(); String key = VerifyUtils.isNotEmpty(id) ? id : clazz.getName(); Object instance = map.get(key); if (instance == null) { BeanDefinition b = findBeanDefinition(key); if (b != null) instance = inject(b); } if (instance != null) { try { field.set(object, instance); } catch (Throwable t) { log.error("field injecting error", t); } } } }
private void fieldInject(AnnotationBeanDefinition beanDefinition, final Object object) { for (Field field : beanDefinition.getInjectFields()) { field.setAccessible(true); Class<?> clazz = field.getType(); String id = field.getAnnotation(Inject.class).value(); String key = VerifyUtils.isNotEmpty(id) ? id : clazz.getName(); Object instance = map.get(key); if (instance == null) { BeanDefinition b = findBeanDefinition(key); if (b != null) instance = inject(b); } if (instance != null) { try { field.set(object, instance); } catch (Throwable t) { log.error("field injecting error", t); } } } }
@SuppressWarnings("unchecked") private Object getListArg(ManagedList<XmlManagedNode> values, Class<?> setterParamType) { Collection<Object> collection = null; if (VerifyUtils.isNotEmpty(values.getTypeName())) { try { collection = (Collection<Object>) XmlApplicationContext.class .getClassLoader() .loadClass(values.getTypeName()) .newInstance(); } catch (Throwable t) { log.error("list inject error", t); } } else { collection = (setterParamType == null ? new ArrayList<>() : ConvertUtils.getCollectionObj(setterParamType)); } if (collection != null) { for (XmlManagedNode item : values) { Object listValue = getInjectArg(item, null); collection.add(listValue); } } return collection; }
@SuppressWarnings("unchecked") private Object getListArg(ManagedList<XmlManagedNode> values, Class<?> setterParamType) { Collection<Object> collection = null; if (VerifyUtils.isNotEmpty(values.getTypeName())) { try { collection = (Collection<Object>) XmlApplicationContext.class .getClassLoader() .loadClass(values.getTypeName()) .newInstance(); } catch (Throwable t) { log.error("list inject error", t); } } else { collection = (setterParamType == null ? new ArrayList<>() : ConvertUtils.getCollectionObj(setterParamType)); } if (collection != null) { for (XmlManagedNode item : values) { Object listValue = getInjectArg(item, null); collection.add(listValue); } } return collection; }
public static String generateSetCookie(Cookie cookie) { if (cookie == null) { throw new IllegalArgumentException("the cookie is null"); } else { StringBuilder sb = new StringBuilder(); sb.append(cookie.getName()).append('=').append(cookie.getValue()); if (VerifyUtils.isNotEmpty(cookie.getComment())) { sb.append(";Comment=").append(cookie.getComment()); } if (VerifyUtils.isNotEmpty(cookie.getDomain())) { sb.append(";Domain=").append(cookie.getDomain()); } if (cookie.getMaxAge() >= 0) { sb.append(";Max-Age=").append(cookie.getMaxAge()); } String path = VerifyUtils.isEmpty(cookie.getPath()) ? "/" : cookie.getPath(); sb.append(";Path=").append(path); if (cookie.getSecure()) { sb.append(";Secure"); } sb.append(";Version=").append(cookie.getVersion()); return sb.toString(); } }
public static String generateSetCookie(Cookie cookie) { if (cookie == null) { throw new IllegalArgumentException("the cookie is null"); } else { StringBuilder sb = new StringBuilder(); sb.append(cookie.getName()).append('=').append(cookie.getValue()); if (VerifyUtils.isNotEmpty(cookie.getComment())) { sb.append(";Comment=").append(cookie.getComment()); } if (VerifyUtils.isNotEmpty(cookie.getDomain())) { sb.append(";Domain=").append(cookie.getDomain()); } if (cookie.getMaxAge() >= 0) { sb.append(";Max-Age=").append(cookie.getMaxAge()); } String path = VerifyUtils.isEmpty(cookie.getPath()) ? "/" : cookie.getPath(); sb.append(";Path=").append(path); if (cookie.getSecure()) { sb.append(";Secure"); } sb.append(";Version=").append(cookie.getVersion()); return sb.toString(); } }
@SuppressWarnings("unchecked") private Object getMapArg(ManagedMap<XmlManagedNode, XmlManagedNode> values, Class<?> setterParamType) { Map<Object, Object> m = null; if (VerifyUtils.isNotEmpty(values.getTypeName())) { try { m = (Map<Object, Object>) XmlApplicationContext.class.getClassLoader() .loadClass(values.getTypeName()) .newInstance(); } catch (Throwable t) { log.error("map inject error", t); } } else { m = (setterParamType == null ? new HashMap<>() : ConvertUtils.getMapObj(setterParamType)); if (m != null && log.isDebugEnabled()) { log.debug("map ret [{}]", m.getClass().getName()); } } if (m != null) { for (XmlManagedNode o : values.keySet()) { Object k = getInjectArg(o, null); Object v = getInjectArg(values.get(o), null); m.put(k, v); } } return m; }
protected void addObjectToContext(final BeanDefinition beanDefinition, final Object object) { // context key using id String id = beanDefinition.getId(); if (VerifyUtils.isNotEmpty(id)) { map.put(id, object); } // context key using class name map.put(beanDefinition.getClassName(), object); // context key using interface name String[] keys = beanDefinition.getInterfaceNames(); for (String k : keys) { map.put(k, object); } if (log.isDebugEnabled()) { log.debug("add object [{}] - [{}] to context", beanDefinition.getClass(), object.toString()); } // invoke initial method Method initMethod = beanDefinition.getInitMethod(); if (initMethod != null) { Pair<Method, Object> pair = new Pair<>(initMethod, object); initMethods.add(pair); } Method destroyedMethod = beanDefinition.getDestroyedMethod(); if (destroyedMethod != null) { Pair<Method, Object> pair = new Pair<>(destroyedMethod, object); destroyedMethods.add(pair); } }
@SuppressWarnings("unchecked") private Object getMapArg(ManagedMap<XmlManagedNode, XmlManagedNode> values, Class<?> setterParamType) { Map<Object, Object> m = null; if (VerifyUtils.isNotEmpty(values.getTypeName())) { try { m = (Map<Object, Object>) XmlApplicationContext.class.getClassLoader() .loadClass(values.getTypeName()) .newInstance(); } catch (Throwable t) { log.error("map inject error", t); } } else { m = (setterParamType == null ? new HashMap<>() : ConvertUtils.getMapObj(setterParamType)); if (m != null && log.isDebugEnabled()) { log.debug("map ret [{}]", m.getClass().getName()); } } if (m != null) { for (XmlManagedNode o : values.keySet()) { Object k = getInjectArg(o, null); Object v = getInjectArg(values.get(o), null); m.put(k, v); } } return m; }
protected void addObjectToContext(final BeanDefinition beanDefinition, final Object object) { // context key using id String id = beanDefinition.getId(); if (VerifyUtils.isNotEmpty(id)) { map.put(id, object); } // context key using class name map.put(beanDefinition.getClassName(), object); // context key using interface name String[] keys = beanDefinition.getInterfaceNames(); for (String k : keys) { map.put(k, object); } if (log.isDebugEnabled()) { log.debug("add object [{}] - [{}] to context", beanDefinition.getClass(), object.toString()); } // invoke initial method Method initMethod = beanDefinition.getInitMethod(); if (initMethod != null) { Pair<Method, Object> pair = new Pair<>(initMethod, object); initMethods.add(pair); } Method destroyedMethod = beanDefinition.getDestroyedMethod(); if (destroyedMethod != null) { Pair<Method, Object> pair = new Pair<>(destroyedMethod, object); destroyedMethods.add(pair); } }
if (VerifyUtils.isNotEmpty(b1.getId()) && VerifyUtils.isNotEmpty(b2.getId()) && b1.getId().equals(b2.getId())) { error("Duplicated bean ID of " + b1.getClassName() + " and " + b2.getClassName());
if (VerifyUtils.isNotEmpty(b1.getId()) && VerifyUtils.isNotEmpty(b2.getId()) && b1.getId().equals(b2.getId())) { error("Duplicated bean ID of " + b1.getClassName() + " and " + b2.getClassName());
if (VerifyUtils.isNotEmpty(path)) { File file = new File(path); createLogDirectorySuccess = createLogDirectory(file);