1

I am studding automatic code generation (AspectJ), and I am confusing about the deference between the following pattern signatures:

  1. javax..*Model
  2. javax..*Model+
  3. javax.*Model
  4. javax.*Model()

Is this answers correct ?

  1. Method that end with Model, which defined under javax package.
  2. Any sub-type of Method that end with Model under javax package.
  3. Method that end with Model inherited from javax class.
  4. Method that end with Model inherited from javax class with no argument.

or there is no difference between them ??

Thanks,

1 Answers1

0

It actually depends where you use those. By themselves, they can identify a type, method or field, depending on the pointcut you use.

Here are a description of the different syntax, and how they relate to your question :

  1. Type poincuts

    [annotations] [modifiers] type_name

    • javax..*Model will match any type (ie : class, interface or enum) with a name which ends with Model, in the javax package.
    • javax..*Model+ will match any subtype of a type with a name which ends with Model, in the javax package.
  2. Method poincuts

    [annotations] [modifiers] return_type method_name (arguments)

    • * javax..*Model.*(..) will match any method declared in a class with a name which ends with Model, in the javax package.
XGouchet
  • 10,002
  • 10
  • 48
  • 83