Ejemplo n.º 1
0
  /**
   * Contructor to be used by all child classes to create a new instance and get the name right.
   *
   * @param clazz the Grails class
   * @param trailingName the trailing part of the name for this class type
   */
  public AbstractGrailsClass(Class clazz, String trailingName) {
    super();
    setClazz(clazz);

    this.reference = new BeanWrapperImpl(newInstance());
    this.fullName = clazz.getName();
    this.packageName = ClassUtils.getPackageName(clazz);
    this.naturalName = GrailsNameUtils.getNaturalName(clazz.getName());
    this.shortName = getShortClassname(clazz);
    this.name = GrailsNameUtils.getLogicalName(clazz, trailingName);
  }