private <T> T read(Class<T> type, Element element, String attribute) {
    String value = element.getAttributeValue(attribute);
    if (value != null) {
      value = value.trim();
      if (value.isEmpty()) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("empty attribute: " + attribute);
        }
      }
      else {
        try {
          return convert(type, value);
        }
        catch (Exception exception) {
          if (LOG.isDebugEnabled()) {
            LOG.debug("wrong attribute: " + attribute, exception);
          }
        }
      }
    }
    return null;
  }
private <T> T read(Class<T> type, Element element, String attribute)