com.sun.tools.xjc.model
Class ClassNameAllocatorWrapper

java.lang.Object
  extended by com.sun.tools.xjc.model.ClassNameAllocatorWrapper
All Implemented Interfaces:
ClassNameAllocator

final class ClassNameAllocatorWrapper
extends Object
implements ClassNameAllocator

Wraps ClassNameAllocator and provides convenience.


Constructor Summary
ClassNameAllocatorWrapper(ClassNameAllocator core)
           
 
Method Summary
 String assignClassName(CClassInfoParent parent, String className)
           
 String assignClassName(com.sun.codemodel.JPackage pkg, String className)
           
 String assignClassName(String packageName, String className)
          Hook that allows the client of the XJC API to rename some of the JAXB-generated classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassNameAllocatorWrapper

ClassNameAllocatorWrapper(ClassNameAllocator core)
Method Detail

assignClassName

public String assignClassName(String packageName,
                              String className)
Description copied from interface: ClassNameAllocator
Hook that allows the client of the XJC API to rename some of the JAXB-generated classes.

When registered, this calllbcak is consulted for every package-level classes/interfaces/enums (hereafter, simply "classes") that the JAXB RI generates. Note that the JAXB RI does not use this allocator for nested/inner classes.

If the allocator chooses to rename some classes. It is the allocator's responsibility to find unique names. If the returned name collides with other classes, the JAXB RI will report errors.

Specified by:
assignClassName in interface ClassNameAllocator
Parameters:
packageName - The package name, such as "" or "foo.bar". Never be null.
className - The short name of the proposed class name. Such as "Foo" or "Bar". Never be null, never be empty. Always a valid Java identifier.
Returns:
The short name of the class name that should be used. The class will be generated into the same package with this name. The return value must be a valid Java identifier. May not be null.

assignClassName

public String assignClassName(com.sun.codemodel.JPackage pkg,
                              String className)

assignClassName

public String assignClassName(CClassInfoParent parent,
                              String className)