Hi, xdoclet devs.

I have some ideas about restricted source directory.

Well I am start from my requirement:
I have 2 project modules, for example myproject-base and myproject-web

myproject-base contains base classes and other common stuff. It contains BasePersistenseObject

class BasePersistenseObject {
  /** @hibernate.property type="string" column="col1" .... */
  getCreateAt()

  // Other 20 properties...
}

BasePersistenseObject have a lot of xdoclet stuff.

myproject-web module have classes that extend BasePersistenseObject i.e.

/** @hibernate.class */
class User extends BasePersistenseObject {
  /** @hibernate.property type="string" column="col1" .... */
   getUserName();
}

I want to generate hibernate mappings for mappings that are in myweb module. Because I want that User get all xdoclet stuff
from BasePersistenseObject I need to attach sources of base module to xdoclet task. So I add <path-to-myproject-base-module> to
maven.xdoclet.0.fileset.0.dir property.

Well now xdoclet generates User with 'createdAt' property as needed but it is also generates mappings for a lot of classes that are located in
base project. I don't want it.

There is my solution: add to plugin (probably in xdoclet or generama) property restrictedDirs that is list of pathes.
In shouldGenerate() method we check if generated file located in any directory from this list then skip generation.

What do you think. Have you any suggestions? If you have no any objections then I start to implement this functionality.
--
anatol

Reply via email to