com.softwareag.centrasite.appl.framework.generator
Interface RegistryBeanGenerator

All Known Implementing Classes:
RegistryBeanGeneratorImpl

public interface RegistryBeanGenerator

Generates RegistryEntry interface and implementation on basis object type name already present in CentraSite Registry/Repository. In order to retrieve instance as stand alone client use RegistryBeanGeneratorFactory. If already established CSAF Session Context is present, instance can be retrieved out of it.

See Also:
RegistryBeanGeneratorFactory

Nested Class Summary
static class RegistryBeanGenerator.ResultType
          Used as Key of the Map returned by generate(String, String, String) method.
 
Method Summary
 java.util.Map<RegistryBeanGenerator.ResultType,java.lang.String> generate(java.lang.String objectType, java.lang.String interfacePackage, java.lang.String implementationPackage)
          Generates all of the java source code artifacts comprising a CSAF RegistryEntry.
 

Method Detail

generate

java.util.Map<RegistryBeanGenerator.ResultType,java.lang.String> generate(java.lang.String objectType,
                                                                          java.lang.String interfacePackage,
                                                                          java.lang.String implementationPackage)
                                                                          throws CSAppFrameworkException
Generates all of the java source code artifacts comprising a CSAF RegistryEntry. This includes the RegistryEntry derived interface of the CSAF Registry Bean and the implementation of this interface.
If the object type is virtual additional virtual type related java source code artifacts will be generated.

Usage example

 RegistryBeanGenerator generator = RegistryBeanGeneratorFactory.createRegistryBeanGeneratorInstance(this.provider);
 
 Map result = generator.generate("{http://myNameSpace}MyType", "com.mytype", "com.mytype.impl");
 
 // The name of the generated base interface. Usually this is the simple name
 // of the type ("MyType" in this example). If the type name contains characters
 // that are not allowed in Java names, these characters will be replaced by '_'.
 String baseInterfaceName = result.get(ResultType.BASE_TYPE_INTERFACE_NAME);
  
 // The name of the generated base implementation class.
 String baseImplementationName = result.get(ResultType.BASE_TYPE_IMPLEMENTATION_NAME);
  
 // The generated base interface source code.
 String baseInterface      = result.get(ResultType.BASE_TYPE_INTERFACE);
  
 // The generated base implementation class source code.
 // This class implements the base interface.
 String baseImplementation = result.get(ResultType.BASE_TYPE_IMPLEMENTATION);
  
 // The name of the generated interface for the virtual type.
 // null if the specified type is not virtual.
 String virtualInterfaceName      = result.get(ResultType.VIRTUAL_TYPE_INTERFACE_NAME);
  
 // The name of the generated implementation class for the virtual type.
 // null if the specified type is not virtual.
 String virtualImplementationName = result.get(ResultType.VIRTUAL_TYPE_IMPLEMENTATION_NAME);
  
 // The generated interface source code for the virtual type. This interface
 // extends the base interface.
 // null if the specified type is not virtual.
 String virtualInterface      = result.get(ResultType.VIRTUAL_TYPE_INTERFACE);
  
 // The generated implementation class source code for the virtual type.
 // This class implements the virtual interface, and extends the base implementation class.
 // null if the specified type is not virtual.
 String virtualImplementation = result.get(ResultType.VIRTUAL_TYPE_IMPLEMENTATION);
  
 // The interface package as specified in the generate() call.
 String interfacePackage = result.get(ResultType.INTERFACE_PACKAGE);
  
 // The implementation package as specified in the generate() call.
 String implementationPackage = result.get(ResultType.IMPLEMENTATION_PACKAGE);
 

Parameters:
objectType - String representation of QName name of the object type or virtual type.
interfacePackage - The java package in which the generated RegistryEntry interface will reside. Following standard package naming using "." separation.
implementationPackage - The java package in which the generated RegistryEntry implementation will reside. Following standard package naming using "." separation.
Returns:
Map holding the generated java source code artifacts. Keys of the map are one of the RegistryBeanGenerator.ResultType possible values. Virtual type related java source code artifacts will be null unless a virtual type was specified.
Throws:
CSAppFrameworkException