mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
05.04.2009 67405dde9ba213331dab1fc46cb18c485070fd5b
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -83,6 +83,13 @@
  }
  /**
   * The class name that contains the control panel customizations for
   * products.
   */
  private final static String CUSTOMIZATION_CLASS_NAME =
    "org.opends.server.util.ReleaseDefinition";
  /**
   * Enumeration that specify if the operation applies to the install directory
   * only, to the instance directory only, or both.
   */
@@ -1747,6 +1754,37 @@
    }
    return buffer.toString();
  }
  /**
   * Tries to find a customized message in the customization class.  If the
   * customization class does not exist or it does not contain the field
   * as a message, returns the default message.
   * @param <T> the type of the customized object.
   * @param fieldName the name of the field representing a message in the
   * customization class.
   * @param defaultValue the default value.
   * @param valueClass the class of the parametrized value.
   * @return the customized message.
   */
  public static <T> T getCustomizedObject(String fieldName,
      T defaultValue, Class<T> valueClass)
  {
    T value = defaultValue;
    if (!isWebStart())
    {
      try
      {
        Class c = Class.forName(Utils.CUSTOMIZATION_CLASS_NAME);
        Object obj = c.newInstance();
        value = valueClass.cast(c.getField(fieldName).get(obj));
      }
      catch (Exception ex)
      {
      }
    }
    return value;
  }
}
/**