Index: org/exolab/castor/xml/XMLClassDescriptorResolver.java =================================================================== --- org/exolab/castor/xml/XMLClassDescriptorResolver.java (Revision 6897) +++ org/exolab/castor/xml/XMLClassDescriptorResolver.java (Arbeitskopie) @@ -125,9 +125,29 @@ void setClassLoader(ClassLoader loader); /** + * Loads the class descriptor for the class instance specified. The use of this method is useful + * when no mapping is used, as happens when the domain classes hase been generated + * using the XML code generator (in which case instead of a mapping file class + * descriptor files will be generated). + * + * @param className Name of the class for which the associated descriptor should be loaded. + */ + public void addClass(final String className); + + /** + * Loads the class descriptors for the class instances specified. The use of this method is useful + * when no mapping is used, as happens when the domain classes hase been generated + * using the XML code generator (in which case instead of a mapping file class + * descriptor files will be generated). + * + * @param classNames Names of the classes for which the associated descriptors should be loaded. + */ + public void addClasses(final String[] classNames); + + /** * Loads class descriptors from the package specified. The use of this method is useful * when no mapping is used, as happens when the domain classes hase been generated - * using the XML code generator (in which case instead of a mpping file class + * using the XML code generator (in which case instead of a mapping file class * descriptor files will be generated). *

* Please note that this functionality will work only if you provide the .castor.cdr @@ -136,6 +156,35 @@ * @param packageName The package name for the (descriptor) classes * @throws ResolverException If there's a problem loading class descriptors for the given package. */ + public void addPackage(final String packageName) throws ResolverException; + + /** + * Loads class descriptors from the packages specified. The use of this method is useful + * when no mapping is used, as happens when the domain classes hase been generated + * using the XML code generator (in which case instead of a mapping file class + * descriptor files will be generated). + *

+ * Please note that this functionality will work only if you provide the .castor.cdr + * files with your generated classes (as generated by the XML code generator). + *

+ * @param packageNames The package names for the (descriptor) classes + * @throws ResolverException If there's a problem loading class descriptors for the given package. + */ + public void addPackages(final String[] packageNames) throws ResolverException; + + /** + * Loads class descriptors from the package specified. The use of this method is useful + * when no mapping is used, as happens when the domain classes hase been generated + * using the XML code generator (in which case instead of a mapping file class + * descriptor files will be generated). + *

+ * Please note that this functionality will work only if you provide the .castor.cdr + * file with your generated classes (as generated by the XML code generator). + *

+ * @param packageName The package name for the (descriptor) classes + * @throws ResolverException If there's a problem loading class descriptors for the given package. + * @deprecated Please use e.g. #addPackage(String) instead. + */ void loadClassDescriptors(final String packageName) throws ResolverException; Index: org/exolab/castor/xml/util/XMLClassDescriptorResolverImpl.java =================================================================== --- org/exolab/castor/xml/util/XMLClassDescriptorResolverImpl.java (Revision 6898) +++ org/exolab/castor/xml/util/XMLClassDescriptorResolverImpl.java (Arbeitskopie) @@ -533,6 +533,39 @@ /** * {@inheritDoc} */ + public void addClass(final String className) { + loadDescriptorClass(className, _loader); + } + + /** + * {@inheritDoc} + */ + public void addClasses(final String[] classNames) { + for (int i = 0; i < classNames.length; i++) { + addClass(classNames[i]); + } + } + + /** + * {@inheritDoc} + */ + public void addPackage(final String packageName) throws ResolverException { + _descriptorCache.loadCDRList(packageName, _loader); + } + + /** + * {@inheritDoc} + + */ + public void addPackages(final String[] packageNames) throws ResolverException { + for (int i = 0; i < packageNames.length; i++) { + _descriptorCache.loadCDRList(packageNames[i], _loader); + } + } + + /** + * {@inheritDoc} + */ public void loadClassDescriptors(final String packageName) throws ResolverException { _descriptorCache.loadCDRList(packageName, _loader); }