shrinkwrap/descriptors — pull request #54 by kenfinnigan (2012-03-25 03:18:02+00:00)
Title: SHRINKDESC-17

Andrew,

2nd commit, without jira in message, is to fix compile error in static tests as a result of latest changes to master. (btw, If I'd known how to I would have rebased my branch back onto the older commit, but still getting the hang of git)

To summarise the changes in the main commit for SHRINKDESC-17:
- Generate descriptors for facelet tag library, faces config 2.0, faces config 2.1, faces ui component and web partial response (only the 2.1 xsd wasn't present already, just activated generation for rest)
- Modify Metadata addClassElement() and addClassReference() to check for matching package name, in addition to class and namespace. This is to fix a problem where having multiple classes being generated resulted in everything being added to first instance of it. For instance, generating faces 2.0 and 2.1 resulted in all 2.1 classes not being generated because it thought they existed as part of 2.0, based purely on class and namespace check.
- Added a boolean methods variable to xsl, for use in creating methods, for those extension types in xsd that don't result in a class being generated.
- Renamed checkForClassType function in xsl to be checkForReservedKeywords as it seemed a more natural fit given what was currently being checked. I also added a check in this function for "if", which obviously clashes in Java but is an element of navigation-case in faces-config!
- Pass package name into writeDynamicImports function
- Added new writeDynamicImport function that takes package parameter
- Added new versionLessPackageName function (catchy, I know ;-) ) to strip a package name of all trailing numbers
- Various changes in generation of interfaces, implementations and descriptors to distinguish between a class from a package of a different version'd schema that we're currently not generating, and classes in different packages entirely. This was to support import statements, etc such that a type from the javaee5.xsd could be found, but when processing faces-config 2.1, you don't grab classes that have been generated as part of 2.0! (this is where the new writeDynamicImport and versionLessPackageName functions are used)

Hope that explains everything!

In a nutshell, all the above parser and stylesheet changes are to handle generating different versions of the same schema in one execution phase, which comes about because faces config 2.0 and 2.1 are both part of EE5, and not split between EE5 and EE6.