Class CompositeFactory
Note: This class has to be extended to add new UNO-IDL code generation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IUnoCompositecreateAttribute(String name, String type, String flags) Creates an interface attribute.static IUnoCompositecreateFile(org.eclipse.core.resources.IFile filehandle) Creates a Uno composite representing a file from its filename.static IUnoCompositecreateFileContent(String fullname) Creates a uno composite representing the file content skeleton from the type name it should contain.static IUnoCompositecreateInclude(String fullName) Creates a Uno composite representing an include line.static IUnoCompositecreateInterface(String name, boolean isPublished, String[] parentIntfNames) Creates a Uno composite corresponding to an interface with its mandatory parent interfaces.static IUnoCompositecreateInterfaceInheritance(String name, boolean optional) Creates a UNO composite representing an interface inheritance.static IUnoCompositecreateMethod(String name, String type) Creates an interface method.static IUnoCompositecreateMethodArgument(String name, String type, String direction) Create a method argument to be added to a method UNO composite.static IUnoCompositecreateModuleDir(String fullName, IUnoidlProject project) Creates a Uno composite directory.static IUnoCompositecreateModuleSpace(String name) Creates a simple module namespace use.static IUnoCompositecreateModulesSpaces(String fullName) Simple convenient method callingcreateModuleSpace(String)to create cascading modules namespaces.static IUnoCompositecreateService(String name) Creates a default very basic service declaration only using the name and not published.static IUnoCompositecreateService(String name, boolean isPublished) Creates a service declaration text with the default interface.static IUnoCompositecreateService(String name, boolean isPublished, String interfaceFullName) Creates a UNO composite representing a UNO service with an interface inheritance.static IUnoCompositecreateTypeFile(String fullName, IUnoidlProject project) Creates a file node from the fully qualified name of the type which should be described inside.
-
Constructor Details
-
CompositeFactory
public CompositeFactory()
-
-
Method Details
-
createTypeFile
Creates a file node from the fully qualified name of the type which should be described inside.- Parameters:
fullName- is the fully qualified name of the type described in the file to create (eg:org::libreoffice::foo)project- is the uno project in which to add the type.- Returns:
- a Uno composite representing a file, or
nullif the fullName is null or an empty string
-
createFile
Creates a Uno composite representing a file from its filename.- Parameters:
filehandle- the relative filename- Returns:
- a Uno composite of FILE type
- See Also:
-
createFileContent
Creates a uno composite representing the file content skeleton from the type name it should contain. All the file contents has to be added in this composite.The produced result will be of the following form:
#ifndef __define_name_idl__ #define __define_name_idl__ [...] #endif
- Parameters:
fullname- the type fully qualified name (eg:org::foo)- Returns:
- a uno composite representing the file content
-
createInclude
Creates a Uno composite representing an include line. It uses the type's fully qualified name to recompose the file name. It supposes that the type is contained in a file of it's name.If the method is called with the type
foo::XFoo, the filefoo/XFoo.idlwill be returned. The resulting include line is always in <, > characters.- Parameters:
fullName- the fully qualified name of the type to include- Returns:
- a parametrized uno composite
-
createModuleDir
Creates a Uno composite directory.- Parameters:
fullName- is the fully qualified name of the module to create (eg:org::libreoffice::foo)project- is the unoidl project in which to generate the module- Returns:
- a Uno composite directory.
-
createModuleSpace
Creates a simple module namespace use.For example, the produced text for the "foo" module name will be the following:
module foo { };- Parameters:
name- is the module name (egfoo)- Returns:
- the uno composite corresponding to the module.
-
createModulesSpaces
Simple convenient method callingcreateModuleSpace(String)to create cascading modules namespaces.- Parameters:
fullName- is the fully qualified name of the module to create (eg:org::libreoffice::foo)- Returns:
- the top-most composite corresponding to the top-most module
-
createService
public static IUnoComposite createService(String name, boolean isPublished, String interfaceFullName) Creates a UNO composite representing a UNO service with an interface inheritance.The text produced by this method corresponds to the following one
\n[published ]service NAME : INTERFACE { [...] };- Parameters:
name- is the service nameisPublished-trueif the module is a published one.interfaceFullName- is the interface inheritance fully qualified name- Returns:
- the created service composite
- See Also:
-
createService
Creates a service declaration text with the default interface. This one doesn't need to be mentioned in order to be used by UNO:com::sun::star::uno::XInterface.The text produced by this method corresponds to the following one
[published ]service NAME { [...] };- Parameters:
name- is the service nameisPublished-trueif the module is a published one.- Returns:
- the created service composite
- See Also:
-
createService
Creates a default very basic service declaration only using the name and not published.The text produced by this method corresponds to the following one
service NAME { [...] };- Parameters:
name- is the service name- Returns:
- the created service composite
- See Also:
-
createInterface
public static IUnoComposite createInterface(String name, boolean isPublished, String[] parentIntfNames) Creates a Uno composite corresponding to an interface with its mandatory parent interfaces.This method returns two kind of texts depending on the number of parent interfaces name in the array. The first writing is used when there is only one parent interface:
[published ]interface name [: parent::name ]{ [...] };The other way is used when there are more than one parent interfaces:
\n[published ]interface name { [[optional] ]interface parent::name; // for each parent [...] };- Parameters:
name- is the name of the interface (eg:foo)isPublished-trueif the interface is publishedparentIntfNames- array of all the mandatory parent interfaces- Returns:
- a uno composite representing an interface declaration
- See Also:
-
createInterfaceInheritance
Creates a UNO composite representing an interface inheritance.The generated text is formatted as following:
\t[[optional] ]interface inheritance::name;\n
- Parameters:
name- the fully qualified name of the interface to inherit fromoptional-trueif the interface is optional- Returns:
- a UNO composite
-
createAttribute
Creates an interface attribute.- Parameters:
name- the attribute nametype- the type of the attributeflags- the well-formatted string of flags.- Returns:
- the attribute UNO composite
-
createMethod
Creates an interface method.- Parameters:
name- the method nametype- the method return type- Returns:
- the UNO composite representing the method
- See Also:
-
createMethodArgument
Create a method argument to be added to a method UNO composite.- Parameters:
name- the argument nametype- the argument typedirection- the argument direction amongin,out,inout.- Returns:
- the UNO composite representing the parameter
-