1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "sal/config.h"
24 #include "codemaker/codemaker.hxx"
25 #include "codemaker/commonjava.hxx"
26 #include "codemaker/global.hxx"
28 #include "skeletoncommon.hxx"
29 #include "skeletonjava.hxx"
31 namespace skeletonmaker
{ namespace java
{
34 std::ostream
& o
, ProgramOptions
const & options
,
35 rtl::Reference
< TypeManager
> const & manager
,
36 codemaker::UnoType::Sort sort
, OUString
const & nucleus
, sal_Int32 rank
,
37 std::vector
< OUString
> const & arguments
, bool referenceType
,
40 if (defaultvalue
&& rank
== 0 && sort
<= codemaker::UnoType::Sort::Char
) {
42 case codemaker::UnoType::Sort::Boolean
:
45 case codemaker::UnoType::Sort::Char
:
46 case codemaker::UnoType::Sort::Byte
:
47 case codemaker::UnoType::Sort::Short
:
48 case codemaker::UnoType::Sort::UnsignedShort
:
49 case codemaker::UnoType::Sort::Long
:
50 case codemaker::UnoType::Sort::UnsignedLong
:
51 case codemaker::UnoType::Sort::Hyper
:
52 case codemaker::UnoType::Sort::UnsignedHyper
:
53 case codemaker::UnoType::Sort::Float
:
54 case codemaker::UnoType::Sort::Double
:
63 if (sort
== codemaker::UnoType::Sort::Interface
) {
66 } else if (sort
== codemaker::UnoType::Sort::Any
&& rank
== 0) {
67 o
<< "com.sun.star.uno.Any.VOID";
69 } else if (sort
== codemaker::UnoType::Sort::Type
&& rank
== 0) {
70 o
<< "com.sun.star.uno.Type.VOID";
72 } else if (sort
!= codemaker::UnoType::Sort::Enum
|| rank
!= 0) {
78 codemaker::java::translateUnoToJavaType(
79 sort
, u2b(nucleus
), referenceType
&& rank
== 0));
80 if (sType
.startsWith("java.lang.")) {
81 sType
= sType
.copy(std::strlen("java.lang."));
84 if (!arguments
.empty()) {
86 for (std::vector
< OUString
>::const_iterator
i(arguments
.begin());
87 i
!= arguments
.end(); ++i
)
89 if (i
!= arguments
.begin()) {
92 printType(o
, options
, manager
, *i
, true);
96 for (sal_Int32 i
= 0; i
!= rank
; ++i
) {
103 if (defaultvalue
&& sort
> codemaker::UnoType::Sort::Char
&& rank
== 0) {
104 if (sort
== codemaker::UnoType::Sort::Enum
)
105 o
<< ".getDefault()";
112 std::ostream
& o
, ProgramOptions
const & options
,
113 rtl::Reference
< TypeManager
> const & manager
, OUString
const & name
,
114 bool referenceType
, bool defaultvalue
)
118 std::vector
< OUString
> arguments
;
119 codemaker::UnoType::Sort sort
= manager
->decompose(
120 name
, true, &nucleus
, &rank
, &arguments
, nullptr);
122 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, referenceType
,
126 bool printConstructorParameters(
127 std::ostream
& o
, ProgramOptions
const & options
,
128 rtl::Reference
< TypeManager
> const & manager
,
129 codemaker::UnoType::Sort sort
,
130 rtl::Reference
< unoidl::Entity
> const & entity
, OUString
const & name
,
131 std::vector
< OUString
> const & arguments
)
133 bool previous
= false;
135 case codemaker::UnoType::Sort::PlainStruct
:
137 rtl::Reference
< unoidl::PlainStructTypeEntity
> ent2(
138 dynamic_cast< unoidl::PlainStructTypeEntity
* >(entity
.get()));
140 if (!ent2
->getDirectBase().isEmpty()) {
141 rtl::Reference
< unoidl::Entity
> baseEnt
;
142 codemaker::UnoType::Sort baseSort
= manager
->getSort(
143 ent2
->getDirectBase(), &baseEnt
);
144 previous
= printConstructorParameters(
145 o
, options
, manager
, baseSort
, baseEnt
,
146 ent2
->getDirectBase(), std::vector
< OUString
>());
148 for (std::vector
< unoidl::PlainStructTypeEntity::Member
>::
149 const_iterator
i(ent2
->getDirectMembers().begin());
150 i
!= ent2
->getDirectMembers().end(); ++i
)
156 printType(o
, options
, manager
, i
->type
, false);
158 << codemaker::java::translateUnoToJavaIdentifier(
159 u2b(i
->name
), "param");
163 case codemaker::UnoType::Sort::PolymorphicStructTemplate
:
165 rtl::Reference
< unoidl::PolymorphicStructTypeTemplateEntity
> ent2(
166 dynamic_cast< unoidl::PolymorphicStructTypeTemplateEntity
* >(
170 unoidl::PolymorphicStructTypeTemplateEntity::Member
>::
171 const_iterator
i(ent2
->getMembers().begin());
172 i
!= ent2
->getMembers().end(); ++i
)
178 if (i
->parameterized
) {
181 printType(o
, options
, manager
, i
->type
, false);
184 << codemaker::java::translateUnoToJavaIdentifier(
185 u2b(i
->name
), "param");
189 case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct
:
191 rtl::Reference
< unoidl::PolymorphicStructTypeTemplateEntity
> ent2(
192 dynamic_cast< unoidl::PolymorphicStructTypeTemplateEntity
* >(
196 unoidl::PolymorphicStructTypeTemplateEntity::Member
>::
197 const_iterator
i(ent2
->getMembers().begin());
198 i
!= ent2
->getMembers().end(); ++i
)
204 if (i
->parameterized
) {
205 for (std::vector
< OUString
>::const_iterator
j(
206 ent2
->getTypeParameters().begin());
207 j
!= ent2
->getTypeParameters().end(); ++j
)
211 j
- ent2
->getTypeParameters().begin()];
216 printType(o
, options
, manager
, i
->type
, false);
219 << codemaker::java::translateUnoToJavaIdentifier(
220 u2b(i
->name
), "param");
224 case codemaker::UnoType::Sort::Exception
:
226 rtl::Reference
< unoidl::ExceptionTypeEntity
> ent2(
227 dynamic_cast< unoidl::ExceptionTypeEntity
* >(entity
.get()));
229 if (!ent2
->getDirectBase().isEmpty()) {
230 rtl::Reference
< unoidl::Entity
> baseEnt
;
231 codemaker::UnoType::Sort baseSort
= manager
->getSort(
232 ent2
->getDirectBase(), &baseEnt
);
233 previous
= printConstructorParameters(
234 o
, options
, manager
, baseSort
, baseEnt
,
235 ent2
->getDirectBase(), std::vector
< OUString
>());
237 for (std::vector
< unoidl::ExceptionTypeEntity::Member
>::
238 const_iterator
i(ent2
->getDirectMembers().begin());
239 i
!= ent2
->getDirectMembers().end(); ++i
)
245 printType(o
, options
, manager
, i
->type
, false);
247 << codemaker::java::translateUnoToJavaIdentifier(
248 u2b(i
->name
), "param");
253 throw CannotDumpException(
254 "unexpected entity \"" + name
255 + "\" in call to skeletonmaker::cpp::printConstructorParameters");
260 void printConstructor(
261 std::ostream
& o
, ProgramOptions
const & options
,
262 rtl::Reference
< TypeManager
> const & manager
,
263 codemaker::UnoType::Sort sort
,
264 rtl::Reference
< unoidl::Entity
> const & entity
, OUString
const & name
,
265 std::vector
< OUString
> const & arguments
)
267 o
<< "public " << name
.copy(name
.lastIndexOf('.') + 1) << '(';
268 printConstructorParameters(
269 o
, options
, manager
, sort
, entity
, name
, arguments
);
273 void printMethodParameters(
274 std::ostream
& o
, ProgramOptions
const & options
,
275 rtl::Reference
< TypeManager
> const & manager
,
276 std::vector
< unoidl::InterfaceTypeEntity::Method::Parameter
> const &
280 for (std::vector
< unoidl::InterfaceTypeEntity::Method::Parameter
>::
281 const_iterator
i(parameters
.begin());
282 i
!= parameters
.end(); ++i
)
284 if (i
!= parameters
.begin()) {
288 printType(o
, options
, manager
, i
->type
, false);
290 != unoidl::InterfaceTypeEntity::Method::Parameter::DIRECTION_IN
)
296 o
<< codemaker::java::translateUnoToJavaIdentifier(
297 u2b(i
->name
), "param");
301 void printExceptionSpecification(
302 std::ostream
& o
, ProgramOptions
const & options
,
303 rtl::Reference
< TypeManager
> const & manager
,
304 std::vector
< OUString
> const & exceptions
)
306 if (!exceptions
.empty()) {
308 for (std::vector
< OUString
>::const_iterator
i(exceptions
.begin());
309 i
!= exceptions
.end(); ++i
)
311 if (i
!=exceptions
.begin() ) {
314 printType(o
, options
, manager
, *i
, false);
320 void printSetPropertyMixinBody(
321 std::ostream
& o
, unoidl::InterfaceTypeEntity::Attribute
const & attribute
,
322 OString
const & indentation
)
324 unoidl::AccumulationBasedServiceEntity::Property::Attributes propFlags
325 = checkAdditionalPropertyFlags(attribute
);
327 o
<< "\n" << indentation
<< "{\n";
329 if ( attribute
.bound
) {
330 o
<< indentation
<< " PropertySetMixin.BoundListeners l = "
331 "new PropertySetMixin.BoundListeners();\n\n";
334 o
<< indentation
<< " m_prophlp.prepareSet(\""
335 << attribute
.name
<< "\", ";
336 if ( propFlags
& unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_CONSTRAINED
) {
337 OString fieldtype
= codemaker::convertString(attribute
.type
);
339 sal_Int32 index
= fieldtype
.lastIndexOf('<');
342 bool optional
= false;
343 OStringBuffer
buffer1(64);
344 OStringBuffer
buffer2(64);
347 OString
s(fieldtype
.getToken(0, '<', nPos
));
348 OStringBuffer
buffer(16);
350 buffer
.append(s
.copy(s
.lastIndexOf('/')+1));
352 OString t
= buffer
.makeStringAndClear();
354 if ( t
.equals("((Optional)") ) {
358 buffer1
.append("the_value.IsPresent");
359 buffer2
.append("the_value.Value");
361 buffer1
.insert(0, t
);
362 buffer1
.append(").IsPresent");
363 buffer2
.insert(0, t
);
364 buffer2
.append(").Value");
370 buffer1
.append("the_value.Value");
372 buffer2
.append("the_value.Value");
375 buffer1
.insert(0, t
);
376 buffer1
.append(").Value");
378 buffer2
.insert(0, t
);
379 buffer2
.append(").Value");
382 } while( nPos
<= index
);
384 o
<< "Any.VOID,\n" << indentation
<< " ";
387 o
<< buffer1
.makeStringAndClear();
389 o
<< ") ? " << buffer2
.makeStringAndClear() << " : Any.VOID,\n"
390 << indentation
<< " ";
395 if ( attribute
.bound
)
401 o
<< indentation
<< " synchronized (this) {\n"
402 << indentation
<< " m_" << attribute
.name
403 << " = the_value;\n" << indentation
<< " }\n";
405 if ( attribute
.bound
) {
406 o
<< indentation
<< " l.notifyListeners();\n";
408 o
<< indentation
<< "}\n\n";
411 void printMethods(std::ostream
& o
,
412 ProgramOptions
const & options
, rtl::Reference
< TypeManager
> const & manager
,
413 OUString
const & name
,
414 codemaker::GeneratedTypeSet
& generated
,
415 OString
const & delegate
, OString
const & indentation
,
416 bool defaultvalue
, bool usepropertymixin
)
418 if ( generated
.contains(u2b(name
)) || name
== "com.sun.star.uno.XInterface" ||
420 ( name
== "com.sun.star.lang.XComponent" ||
421 name
== "com.sun.star.lang.XTypeProvider" ||
422 name
== "com.sun.star.uno.XWeak" ) ) ) {
426 if ( usepropertymixin
) {
427 if (name
== "com.sun.star.beans.XPropertySet") {
428 generated
.add(u2b(name
));
429 generateXPropertySetBodies(o
);
431 } else if (name
== "com.sun.star.beans.XFastPropertySet") {
432 generated
.add(u2b(name
));
433 generateXFastPropertySetBodies(o
);
435 } else if (name
== "com.sun.star.beans.XPropertyAccess") {
436 generated
.add(u2b(name
));
437 generateXPropertyAccessBodies(o
);
442 static OString
sd("_");
443 bool body
= !delegate
.isEmpty();
444 bool defaultbody
= delegate
.equals(sd
);
446 generated
.add(u2b(name
));
447 rtl::Reference
< unoidl::Entity
> ent
;
448 if (manager
->getSort(name
, &ent
) != codemaker::UnoType::Sort::Interface
)
450 throw CannotDumpException(
451 "unexpected entity \"" + name
452 + "\" in call to skeletonmaker::java::printMethods");
454 rtl::Reference
< unoidl::InterfaceTypeEntity
> ent2(
455 dynamic_cast< unoidl::InterfaceTypeEntity
* >(ent
.get()));
457 if ( options
.all
|| defaultvalue
) {
458 for (std::vector
< unoidl::AnnotatedReference
>::const_iterator
i(
459 ent2
->getDirectMandatoryBases().begin());
460 i
!= ent2
->getDirectMandatoryBases().end(); ++i
)
463 o
, options
, manager
, i
->name
, generated
, delegate
, indentation
,
464 defaultvalue
, usepropertymixin
);
466 if (!(ent2
->getDirectAttributes().empty()
467 && ent2
->getDirectMethods().empty()))
469 o
<< indentation
<< "// ";
470 printType(o
, options
, manager
, name
, false);
474 for (std::vector
< unoidl::InterfaceTypeEntity::Attribute
>::const_iterator
475 i(ent2
->getDirectAttributes().begin());
476 i
!= ent2
->getDirectAttributes().end(); ++i
)
478 o
<< indentation
<< "public ";
479 printType(o
, options
, manager
, i
->type
, false);
480 o
<< " get" << i
->name
<< "()";
481 printExceptionSpecification(o
, options
, manager
, i
->getExceptions
);
484 if ( usepropertymixin
) {
485 o
<< "\n" << indentation
<< "{\n" << indentation
486 << " return m_" << i
->name
<< ";\n" << indentation
489 o
<< "\n" << indentation
<< "{\n" << indentation
491 printType(o
, options
, manager
, i
->type
, false, true);
492 o
<< ";\n" << indentation
<< "}\n\n";
495 o
<< "\n" << indentation
<< "{\n" << indentation
496 << " return " << delegate
.getStr() << "get" << i
->name
497 << "();\n" << indentation
<< "}\n\n";
505 o
<< indentation
<< "public void set" << i
->name
<< '(';
506 printType(o
, options
, manager
, i
->type
, false);
508 printExceptionSpecification(o
, options
, manager
, i
->setExceptions
);
511 if ( usepropertymixin
) {
512 printSetPropertyMixinBody(o
, *i
, indentation
);
514 o
<< "\n" << indentation
<< "{\n\n" << indentation
518 o
<< "\n" << indentation
<< "{\n" << indentation
519 << " " << delegate
.getStr() << "set" << i
->name
520 << "(the_value);\n" << indentation
<< "}\n\n";
527 for (std::vector
< unoidl::InterfaceTypeEntity::Method
>::const_iterator
i(
528 ent2
->getDirectMethods().begin());
529 i
!= ent2
->getDirectMethods().end(); ++i
)
531 o
<< indentation
<< "public ";
532 printType(o
, options
, manager
, i
->returnType
, false);
533 o
<< ' ' << i
->name
<< '(';
534 printMethodParameters(o
, options
, manager
, i
->parameters
, true);
536 printExceptionSpecification(o
, options
, manager
, i
->exceptions
);
539 o
<< "\n" << indentation
<< "{\n";
540 if (i
->returnType
!= "void") {
541 o
<< indentation
<< " // TODO: Exchange the default return implementation for \"" << i
->name
<< "\" !!!\n";
542 o
<< indentation
<< " // NOTE: "
543 "Default initialized polymorphic structs can cause problems"
544 "\n" << indentation
<< " // because of missing default "
545 "initialization of primitive types of\n" << indentation
546 << " // some C++ compilers or different Any initialization"
547 " in Java and C++\n" << indentation
548 << " // polymorphic structs.\n" << indentation
550 printType(o
, options
, manager
, i
->returnType
, false, true);
553 o
<< indentation
<< " // TODO: Insert your implementation for \""
554 << i
->name
<< "\" here.";
556 o
<< "\n" << indentation
<< "}\n\n";
558 o
<< "\n" << indentation
<< "{\n" << indentation
<< " ";
559 if (i
->returnType
!= "void") {
562 o
<< delegate
.getStr() << i
->name
<< '(';
563 printMethodParameters(
564 o
, options
, manager
, i
->parameters
, false);
565 o
<< ");\n" << indentation
<< "}\n\n";
573 void printConstructors(
574 std::ostream
& o
, ProgramOptions
const & options
,
575 rtl::Reference
< TypeManager
> const & manager
, OUString
const & name
)
577 rtl::Reference
< unoidl::Entity
> ent
;
578 if (manager
->getSort(name
, &ent
)
579 != codemaker::UnoType::Sort::SingleInterfaceBasedService
)
581 throw CannotDumpException(
582 "unexpected entity \"" + name
583 + "\" in call to skeletonmaker::java::printConstructors");
585 rtl::Reference
< unoidl::SingleInterfaceBasedServiceEntity
> ent2(
586 dynamic_cast< unoidl::SingleInterfaceBasedServiceEntity
* >(ent
.get()));
588 for (std::vector
< unoidl::SingleInterfaceBasedServiceEntity::Constructor
>::
589 const_iterator
i(ent2
->getConstructors().begin());
590 i
!= ent2
->getConstructors().end(); ++i
)
592 o
<< "public static ";
593 printType(o
, options
, manager
, ent2
->getBase(), false);
595 if (i
->defaultConstructor
) {
598 o
<< codemaker::java::translateUnoToJavaIdentifier(
599 u2b(i
->name
), "method");
601 o
<< "(com.sun.star.uno.XComponentContext the_context";
603 unoidl::SingleInterfaceBasedServiceEntity::Constructor::
604 Parameter
>::const_iterator
j(i
->parameters
.begin());
605 j
!= i
->parameters
.end(); ++i
)
608 printType(o
, options
, manager
, j
->type
, false);
613 << codemaker::java::translateUnoToJavaIdentifier(
614 u2b(j
->name
), "param");
617 printExceptionSpecification(o
, options
, manager
, i
->exceptions
);
622 void printServiceMembers(
623 std::ostream
& o
, ProgramOptions
const & options
,
624 rtl::Reference
< TypeManager
> const & manager
,
625 OUString
const & name
,
626 rtl::Reference
< unoidl::AccumulationBasedServiceEntity
> const & entity
,
627 OString
const & delegate
)
630 for (std::vector
< unoidl::AnnotatedReference
>::const_iterator
i(
631 entity
->getDirectMandatoryBaseServices().begin());
632 i
!= entity
->getDirectMandatoryBaseServices().end(); ++i
)
634 o
<< "\n// exported service " << i
->name
<< "\n";
635 generateDocumentation(o
, options
, manager
, u2b(i
->name
), delegate
);
637 for (std::vector
< unoidl::AnnotatedReference
>::const_iterator
i(
638 entity
->getDirectMandatoryBaseInterfaces().begin());
639 i
!= entity
->getDirectMandatoryBaseInterfaces().end(); ++i
)
641 o
<< "\n// supported interface " << i
->name
<< "\n";
642 generateDocumentation(o
, options
, manager
, u2b(i
->name
), delegate
);
644 o
<< "\n// properties of service \""<< name
<< "\"\n";
645 for (std::vector
< unoidl::AccumulationBasedServiceEntity::Property
>::
646 const_iterator
i(entity
->getDirectProperties().begin());
647 i
!= entity
->getDirectProperties().end(); ++i
)
650 printType(o
, options
, manager
, i
->type
, false);
652 << codemaker::java::translateUnoToJavaIdentifier(
653 u2b(i
->name
), "property")
658 void printMapsToJavaType(
659 std::ostream
& o
, ProgramOptions
const & options
,
660 rtl::Reference
< TypeManager
> const & manager
,
661 codemaker::UnoType::Sort sort
, OUString
const & nucleus
, sal_Int32 rank
,
662 std::vector
< OUString
> const & arguments
, const char * javaTypeSort
)
664 o
<< "maps to Java 1.5 ";
665 if (javaTypeSort
!= nullptr) {
666 o
<< javaTypeSort
<< ' ';
669 if (rank
== 0 && nucleus
== "com.sun.star.uno.XInterface") {
670 o
<< "com.sun.star.uno.XInterface";
673 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, false, false);
678 void generateDocumentation(std::ostream
& o
,
679 ProgramOptions
const & options
, rtl::Reference
< TypeManager
> const & manager
,
680 OString
const & type
, OString
const & delegate
)
684 codemaker::UnoType::Sort sort
= manager
->decompose(
685 b2u(type
), false, &nucleus
, &rank
, nullptr, nullptr);
688 if (!delegate
.isEmpty()) {
689 if (sort
!= codemaker::UnoType::Sort::Interface
&&
690 sort
!= codemaker::UnoType::Sort::SingleInterfaceBasedService
&&
691 sort
!= codemaker::UnoType::Sort::AccumulationBasedService
)
701 o
<< " sequence type";
702 } else if (sort
<= codemaker::UnoType::Sort::Any
) {
706 case codemaker::UnoType::Sort::Interface
:
707 o
<< " interface type";
710 case codemaker::UnoType::Sort::Module
:
714 case codemaker::UnoType::Sort::PlainStruct
:
715 o
<< " simple struct type";
718 case codemaker::UnoType::Sort::PolymorphicStructTemplate
:
719 o
<< " polymorphic struct type template";
722 case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct
:
723 o
<< " instantiated polymorphic struct type";
726 case codemaker::UnoType::Sort::Enum
:
730 case codemaker::UnoType::Sort::Exception
:
731 o
<< " exception type";
734 case codemaker::UnoType::Sort::Typedef
:
738 case codemaker::UnoType::Sort::SingleInterfaceBasedService
:
739 o
<< " single-inheritance--based service";
742 case codemaker::UnoType::Sort::AccumulationBasedService
:
743 o
<< "IDL accumulation-based service";
746 case codemaker::UnoType::Sort::InterfaceBasedSingleton
:
747 o
<< " inheritance-based singleton";
750 case codemaker::UnoType::Sort::ServiceBasedSingleton
:
751 o
<< "IDL service-based singleton";
754 case codemaker::UnoType::Sort::ConstantGroup
:
755 o
<< "IDL constant group";
763 o
<< " \"" << type
<< "\" ";
765 std::vector
< OUString
> arguments
;
766 rtl::Reference
< unoidl::Entity
> entity
;
767 sort
= manager
->decompose(
768 b2u(type
), true, &nucleus
, &rank
, &arguments
, &entity
);
771 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "array");
773 } else if (sort
<= codemaker::UnoType::Sort::Any
) {
775 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, nullptr);
779 case codemaker::UnoType::Sort::Interface
:
781 o
, options
, manager
, sort
, nucleus
, rank
, arguments
,
783 if (nucleus
== "com.sun.star.uno.XInterface") {
786 o
<< "; " << (options
.all
? "all" : "direct") << " methods:\n";
787 codemaker::GeneratedTypeSet generated
;
789 o
, options
, manager
, nucleus
, generated
, delegate
, "");
793 case codemaker::UnoType::Sort::Module
:
795 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "package");
799 case codemaker::UnoType::Sort::PlainStruct
:
801 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "class");
802 o
<< "; full constructor:\n";
804 o
, options
, manager
, codemaker::UnoType::Sort::PlainStruct
,
805 entity
, nucleus
, arguments
);
808 case codemaker::UnoType::Sort::PolymorphicStructTemplate
:
810 o
, options
, manager
, sort
, nucleus
, rank
, arguments
,
812 o
<< "; full constructor:\n";
815 codemaker::UnoType::Sort::PolymorphicStructTemplate
,
816 entity
, nucleus
, arguments
);
819 case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct
:
821 o
, options
, manager
, sort
, nucleus
, rank
, arguments
,
822 "generic class instantiation");
823 o
<< "; full constructor:\n";
826 codemaker::UnoType::Sort::InstantiatedPolymorphicStruct
,
827 entity
, nucleus
, arguments
);
830 case codemaker::UnoType::Sort::Enum
:
831 case codemaker::UnoType::Sort::ConstantGroup
:
833 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "class");
837 case codemaker::UnoType::Sort::Exception
:
839 o
, options
, manager
, sort
, nucleus
, rank
, arguments
,
841 o
<< "; full constructor:\n";
843 o
, options
, manager
, codemaker::UnoType::Sort::Exception
,
844 entity
, nucleus
, arguments
);
847 case codemaker::UnoType::Sort::SingleInterfaceBasedService
:
849 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "class");
850 o
<< "; construction methods:\n";
851 printConstructors(o
, options
, manager
, nucleus
);
852 generateDocumentation(
854 u2b(dynamic_cast< unoidl::SingleInterfaceBasedServiceEntity
* >(
855 entity
.get())->getBase()),
859 case codemaker::UnoType::Sort::AccumulationBasedService
:
860 o
<< ("does not map to Java\n"
861 "// the service members are generated instead\n");
863 o
, options
, manager
, nucleus
,
864 dynamic_cast< unoidl::AccumulationBasedServiceEntity
* >(
869 case codemaker::UnoType::Sort::InterfaceBasedSingleton
:
871 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "class");
872 o
<< "; get method:\npublic static ";
875 dynamic_cast< unoidl::InterfaceBasedSingletonEntity
* >(
876 entity
.get())->getBase(),
878 o
<< " get(com.sun.star.uno.XComponentContext context);\n";
881 case codemaker::UnoType::Sort::ServiceBasedSingleton
:
882 o
<< "does not map to Java\n";
895 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */