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 <string_view>
26 #include <codemaker/codemaker.hxx>
27 #include <codemaker/commonjava.hxx>
28 #include <codemaker/global.hxx>
30 #include "skeletoncommon.hxx"
31 #include "skeletonjava.hxx"
33 namespace skeletonmaker::java
{
35 static void printType(
36 std::ostream
& o
, ProgramOptions
const & options
,
37 rtl::Reference
< TypeManager
> const & manager
,
38 codemaker::UnoType::Sort sort
, std::u16string_view nucleus
, sal_Int32 rank
,
39 std::vector
< OUString
> const & arguments
, bool referenceType
,
42 if (defaultvalue
&& rank
== 0 && sort
<= codemaker::UnoType::Sort::Char
) {
44 case codemaker::UnoType::Sort::Boolean
:
47 case codemaker::UnoType::Sort::Char
:
48 case codemaker::UnoType::Sort::Byte
:
49 case codemaker::UnoType::Sort::Short
:
50 case codemaker::UnoType::Sort::UnsignedShort
:
51 case codemaker::UnoType::Sort::Long
:
52 case codemaker::UnoType::Sort::UnsignedLong
:
53 case codemaker::UnoType::Sort::Hyper
:
54 case codemaker::UnoType::Sort::UnsignedHyper
:
55 case codemaker::UnoType::Sort::Float
:
56 case codemaker::UnoType::Sort::Double
:
65 if (sort
== codemaker::UnoType::Sort::Interface
) {
68 } else if (sort
== codemaker::UnoType::Sort::Any
&& rank
== 0) {
69 o
<< "com.sun.star.uno.Any.VOID";
71 } else if (sort
== codemaker::UnoType::Sort::Type
&& rank
== 0) {
72 o
<< "com.sun.star.uno.Type.VOID";
74 } else if (sort
!= codemaker::UnoType::Sort::Enum
|| rank
!= 0) {
80 codemaker::java::translateUnoToJavaType(
81 sort
, u2b(nucleus
), referenceType
&& rank
== 0));
82 if (sType
.startsWith("java.lang.")) {
83 sType
= sType
.copy(std::strlen("java.lang."));
86 if (!arguments
.empty()) {
88 for (std::vector
< OUString
>::const_iterator
i(arguments
.begin());
89 i
!= arguments
.end(); ++i
)
91 if (i
!= arguments
.begin()) {
94 printType(o
, options
, manager
, *i
, true);
98 for (sal_Int32 i
= 0; i
!= rank
; ++i
) {
105 if (defaultvalue
&& sort
> codemaker::UnoType::Sort::Char
&& rank
== 0) {
106 if (sort
== codemaker::UnoType::Sort::Enum
)
107 o
<< ".getDefault()";
114 std::ostream
& o
, ProgramOptions
const & options
,
115 rtl::Reference
< TypeManager
> const & manager
, std::u16string_view name
,
116 bool referenceType
, bool defaultvalue
)
120 std::vector
< OUString
> arguments
;
121 codemaker::UnoType::Sort sort
= manager
->decompose(
122 name
, true, &nucleus
, &rank
, &arguments
, nullptr);
124 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, referenceType
,
128 static bool printConstructorParameters(
129 std::ostream
& o
, ProgramOptions
const & options
,
130 rtl::Reference
< TypeManager
> const & manager
,
131 codemaker::UnoType::Sort sort
,
132 rtl::Reference
< unoidl::Entity
> const & entity
, std::u16string_view name
,
133 std::vector
< OUString
> const & arguments
)
135 bool previous
= false;
137 case codemaker::UnoType::Sort::PlainStruct
:
139 rtl::Reference
< unoidl::PlainStructTypeEntity
> ent2(
140 dynamic_cast< unoidl::PlainStructTypeEntity
* >(entity
.get()));
142 if (!ent2
->getDirectBase().isEmpty()) {
143 rtl::Reference
< unoidl::Entity
> baseEnt
;
144 codemaker::UnoType::Sort baseSort
= manager
->getSort(
145 ent2
->getDirectBase(), &baseEnt
);
146 previous
= printConstructorParameters(
147 o
, options
, manager
, baseSort
, baseEnt
,
148 ent2
->getDirectBase(), std::vector
< OUString
>());
150 for (const auto& rMember
: ent2
->getDirectMembers())
156 printType(o
, options
, manager
, rMember
.type
, false);
158 << codemaker::java::translateUnoToJavaIdentifier(
159 u2b(rMember
.name
), "param");
163 case codemaker::UnoType::Sort::PolymorphicStructTemplate
:
165 rtl::Reference
< unoidl::PolymorphicStructTypeTemplateEntity
> ent2(
166 dynamic_cast< unoidl::PolymorphicStructTypeTemplateEntity
* >(
169 for (const auto& rMember
: ent2
->getMembers())
175 if (rMember
.parameterized
) {
178 printType(o
, options
, manager
, rMember
.type
, false);
181 << codemaker::java::translateUnoToJavaIdentifier(
182 u2b(rMember
.name
), "param");
186 case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct
:
188 rtl::Reference
< unoidl::PolymorphicStructTypeTemplateEntity
> ent2(
189 dynamic_cast< unoidl::PolymorphicStructTypeTemplateEntity
* >(
192 for (const auto& rMember
: ent2
->getMembers())
198 if (rMember
.parameterized
) {
199 auto j
= std::find(ent2
->getTypeParameters().begin(),
200 ent2
->getTypeParameters().end(), rMember
.type
);
201 if (j
!= ent2
->getTypeParameters().end()) {
202 o
<< arguments
[j
- ent2
->getTypeParameters().begin()];
205 printType(o
, options
, manager
, rMember
.type
, false);
208 << codemaker::java::translateUnoToJavaIdentifier(
209 u2b(rMember
.name
), "param");
213 case codemaker::UnoType::Sort::Exception
:
215 rtl::Reference
< unoidl::ExceptionTypeEntity
> ent2(
216 dynamic_cast< unoidl::ExceptionTypeEntity
* >(entity
.get()));
218 if (!ent2
->getDirectBase().isEmpty()) {
219 rtl::Reference
< unoidl::Entity
> baseEnt
;
220 codemaker::UnoType::Sort baseSort
= manager
->getSort(
221 ent2
->getDirectBase(), &baseEnt
);
222 previous
= printConstructorParameters(
223 o
, options
, manager
, baseSort
, baseEnt
,
224 ent2
->getDirectBase(), std::vector
< OUString
>());
226 for (const auto& rMember
: ent2
->getDirectMembers())
232 printType(o
, options
, manager
, rMember
.type
, false);
234 << codemaker::java::translateUnoToJavaIdentifier(
235 u2b(rMember
.name
), "param");
240 throw CannotDumpException(
241 OUString::Concat("unexpected entity \"") + name
242 + "\" in call to skeletonmaker::cpp::printConstructorParameters");
247 static void printConstructor(
248 std::ostream
& o
, ProgramOptions
const & options
,
249 rtl::Reference
< TypeManager
> const & manager
,
250 codemaker::UnoType::Sort sort
,
251 rtl::Reference
< unoidl::Entity
> const & entity
, std::u16string_view name
,
252 std::vector
< OUString
> const & arguments
)
254 o
<< "public " << OUString(name
.substr(name
.rfind('.') + 1)) << '(';
255 printConstructorParameters(
256 o
, options
, manager
, sort
, entity
, name
, arguments
);
260 static void printMethodParameters(
261 std::ostream
& o
, ProgramOptions
const & options
,
262 rtl::Reference
< TypeManager
> const & manager
,
263 std::vector
< unoidl::InterfaceTypeEntity::Method::Parameter
> const &
267 for (std::vector
< unoidl::InterfaceTypeEntity::Method::Parameter
>::
268 const_iterator
i(parameters
.begin());
269 i
!= parameters
.end(); ++i
)
271 if (i
!= parameters
.begin()) {
275 printType(o
, options
, manager
, i
->type
, false);
277 != unoidl::InterfaceTypeEntity::Method::Parameter::DIRECTION_IN
)
283 o
<< codemaker::java::translateUnoToJavaIdentifier(
284 u2b(i
->name
), "param");
288 static void printExceptionSpecification(
289 std::ostream
& o
, ProgramOptions
const & options
,
290 rtl::Reference
< TypeManager
> const & manager
,
291 std::vector
< OUString
> const & exceptions
)
293 if (!exceptions
.empty()) {
295 for (std::vector
< OUString
>::const_iterator
i(exceptions
.begin());
296 i
!= exceptions
.end(); ++i
)
298 if (i
!=exceptions
.begin() ) {
301 printType(o
, options
, manager
, *i
, false);
307 static void printSetPropertyMixinBody(
308 std::ostream
& o
, unoidl::InterfaceTypeEntity::Attribute
const & attribute
,
309 OString
const & indentation
)
311 unoidl::AccumulationBasedServiceEntity::Property::Attributes propFlags
312 = checkAdditionalPropertyFlags(attribute
);
314 o
<< "\n" << indentation
<< "{\n";
316 if ( attribute
.bound
) {
317 o
<< indentation
<< " PropertySetMixin.BoundListeners l = "
318 "new PropertySetMixin.BoundListeners();\n\n";
321 o
<< indentation
<< " m_prophlp.prepareSet(\""
322 << attribute
.name
<< "\", ";
323 if ( propFlags
& unoidl::AccumulationBasedServiceEntity::Property::ATTRIBUTE_CONSTRAINED
) {
324 OString fieldtype
= codemaker::convertString(attribute
.type
);
326 sal_Int32 index
= fieldtype
.lastIndexOf('<');
329 bool optional
= false;
330 OStringBuffer
buffer1(64);
331 OStringBuffer
buffer2(64);
334 OString
s(fieldtype
.getToken(0, '<', nPos
));
335 OString t
{ OString::Concat("((") + s
.subView(s
.lastIndexOf('/')+1) + ")" };
337 if ( t
== "((Optional)" ) {
341 buffer1
.append("the_value.IsPresent");
342 buffer2
.append("the_value.Value");
344 buffer1
.insert(0, t
);
345 buffer1
.append(").IsPresent");
346 buffer2
.insert(0, t
);
347 buffer2
.append(").Value");
353 buffer1
.append("the_value.Value");
355 buffer2
.append("the_value.Value");
358 buffer1
.insert(0, t
);
359 buffer1
.append(").Value");
361 buffer2
.insert(0, t
);
362 buffer2
.append(").Value");
365 } while( nPos
<= index
);
367 o
<< "Any.VOID,\n" << indentation
<< " ";
370 o
<< buffer1
.makeStringAndClear();
372 o
<< ") ? " << buffer2
.makeStringAndClear() << " : Any.VOID,\n"
373 << indentation
<< " ";
378 if ( attribute
.bound
)
384 o
<< indentation
<< " synchronized (this) {\n"
385 << indentation
<< " m_" << attribute
.name
386 << " = the_value;\n" << indentation
<< " }\n";
388 if ( attribute
.bound
) {
389 o
<< indentation
<< " l.notifyListeners();\n";
391 o
<< indentation
<< "}\n\n";
394 void printMethods(std::ostream
& o
,
395 ProgramOptions
const & options
, rtl::Reference
< TypeManager
> const & manager
,
396 OUString
const & name
,
397 codemaker::GeneratedTypeSet
& generated
,
398 OString
const & delegate
, OString
const & indentation
,
399 bool defaultvalue
, bool usepropertymixin
)
401 if ( generated
.contains(u2b(name
)) || name
== "com.sun.star.uno.XInterface" ||
403 ( name
== "com.sun.star.lang.XComponent" ||
404 name
== "com.sun.star.lang.XTypeProvider" ||
405 name
== "com.sun.star.uno.XWeak" ) ) ) {
409 if ( usepropertymixin
) {
410 if (name
== "com.sun.star.beans.XPropertySet") {
411 generated
.add(u2b(name
));
412 generateXPropertySetBodies(o
);
414 } else if (name
== "com.sun.star.beans.XFastPropertySet") {
415 generated
.add(u2b(name
));
416 generateXFastPropertySetBodies(o
);
418 } else if (name
== "com.sun.star.beans.XPropertyAccess") {
419 generated
.add(u2b(name
));
420 generateXPropertyAccessBodies(o
);
425 static OString
sd("_"_ostr
);
426 bool body
= !delegate
.isEmpty();
427 bool defaultbody
= delegate
== sd
;
429 generated
.add(u2b(name
));
430 rtl::Reference
< unoidl::Entity
> ent
;
431 if (manager
->getSort(name
, &ent
) != codemaker::UnoType::Sort::Interface
)
433 throw CannotDumpException(
434 "unexpected entity \"" + name
435 + "\" in call to skeletonmaker::java::printMethods");
437 rtl::Reference
< unoidl::InterfaceTypeEntity
> ent2(
438 dynamic_cast< unoidl::InterfaceTypeEntity
* >(ent
.get()));
440 if ( options
.all
|| defaultvalue
) {
441 for (const auto& rBase
: ent2
->getDirectMandatoryBases())
444 o
, options
, manager
, rBase
.name
, generated
, delegate
, indentation
,
445 defaultvalue
, usepropertymixin
);
447 if (!(ent2
->getDirectAttributes().empty()
448 && ent2
->getDirectMethods().empty()))
450 o
<< indentation
<< "// ";
451 printType(o
, options
, manager
, name
, false);
455 for (const auto& rAttr
: ent2
->getDirectAttributes())
457 o
<< indentation
<< "public ";
458 printType(o
, options
, manager
, rAttr
.type
, false);
459 o
<< " get" << rAttr
.name
<< "()";
460 printExceptionSpecification(o
, options
, manager
, rAttr
.getExceptions
);
463 if ( usepropertymixin
) {
464 o
<< "\n" << indentation
<< "{\n" << indentation
465 << " return m_" << rAttr
.name
<< ";\n" << indentation
468 o
<< "\n" << indentation
<< "{\n" << indentation
470 printType(o
, options
, manager
, rAttr
.type
, false, true);
471 o
<< ";\n" << indentation
<< "}\n\n";
474 o
<< "\n" << indentation
<< "{\n" << indentation
475 << " return " << delegate
<< "get" << rAttr
.name
476 << "();\n" << indentation
<< "}\n\n";
483 if (!rAttr
.readOnly
) {
484 o
<< indentation
<< "public void set" << rAttr
.name
<< '(';
485 printType(o
, options
, manager
, rAttr
.type
, false);
487 printExceptionSpecification(o
, options
, manager
, rAttr
.setExceptions
);
490 if ( usepropertymixin
) {
491 printSetPropertyMixinBody(o
, rAttr
, indentation
);
493 o
<< "\n" << indentation
<< "{\n\n" << indentation
497 o
<< "\n" << indentation
<< "{\n" << indentation
498 << " " << delegate
<< "set" << rAttr
.name
499 << "(the_value);\n" << indentation
<< "}\n\n";
506 for (const auto& rMethod
: ent2
->getDirectMethods())
508 o
<< indentation
<< "public ";
509 printType(o
, options
, manager
, rMethod
.returnType
, false);
510 o
<< ' ' << rMethod
.name
<< '(';
511 printMethodParameters(o
, options
, manager
, rMethod
.parameters
, true);
513 printExceptionSpecification(o
, options
, manager
, rMethod
.exceptions
);
516 o
<< "\n" << indentation
<< "{\n";
517 if (rMethod
.returnType
!= "void") {
518 o
<< indentation
<< " // TODO: Exchange the default return implementation for \"" << rMethod
.name
<< "\" !!!\n";
519 o
<< indentation
<< " // NOTE: "
520 "Default initialized polymorphic structs can cause problems"
521 "\n" << indentation
<< " // because of missing default "
522 "initialization of primitive types of\n" << indentation
523 << " // some C++ compilers or different Any initialization"
524 " in Java and C++\n" << indentation
525 << " // polymorphic structs.\n" << indentation
527 printType(o
, options
, manager
, rMethod
.returnType
, false, true);
530 o
<< indentation
<< " // TODO: Insert your implementation for \""
531 << rMethod
.name
<< "\" here.";
533 o
<< "\n" << indentation
<< "}\n\n";
535 o
<< "\n" << indentation
<< "{\n" << indentation
<< " ";
536 if (rMethod
.returnType
!= "void") {
539 o
<< delegate
<< rMethod
.name
<< '(';
540 printMethodParameters(
541 o
, options
, manager
, rMethod
.parameters
, false);
542 o
<< ");\n" << indentation
<< "}\n\n";
550 static void printConstructors(
551 std::ostream
& o
, ProgramOptions
const & options
,
552 rtl::Reference
< TypeManager
> const & manager
, OUString
const & name
)
554 rtl::Reference
< unoidl::Entity
> ent
;
555 if (manager
->getSort(name
, &ent
)
556 != codemaker::UnoType::Sort::SingleInterfaceBasedService
)
558 throw CannotDumpException(
559 "unexpected entity \"" + name
560 + "\" in call to skeletonmaker::java::printConstructors");
562 rtl::Reference
< unoidl::SingleInterfaceBasedServiceEntity
> ent2(
563 dynamic_cast< unoidl::SingleInterfaceBasedServiceEntity
* >(ent
.get()));
565 for (const auto& rConstructor
: ent2
->getConstructors())
567 o
<< "public static ";
568 printType(o
, options
, manager
, ent2
->getBase(), false);
570 if (rConstructor
.defaultConstructor
) {
573 o
<< codemaker::java::translateUnoToJavaIdentifier(
574 u2b(rConstructor
.name
), "method");
576 o
<< "(com.sun.star.uno.XComponentContext the_context";
577 for (const auto& rParam
: rConstructor
.parameters
)
580 printType(o
, options
, manager
, rParam
.type
, false);
585 << codemaker::java::translateUnoToJavaIdentifier(
586 u2b(rParam
.name
), "param");
589 printExceptionSpecification(o
, options
, manager
, rConstructor
.exceptions
);
594 static void printServiceMembers(
595 std::ostream
& o
, ProgramOptions
const & options
,
596 rtl::Reference
< TypeManager
> const & manager
,
597 OUString
const & name
,
598 rtl::Reference
< unoidl::AccumulationBasedServiceEntity
> const & entity
,
599 OString
const & delegate
)
602 for (const auto& rService
: entity
->getDirectMandatoryBaseServices())
604 o
<< "\n// exported service " << rService
.name
<< "\n";
605 generateDocumentation(o
, options
, manager
, u2b(rService
.name
), delegate
);
607 for (const auto& rIface
: entity
->getDirectMandatoryBaseInterfaces())
609 o
<< "\n// supported interface " << rIface
.name
<< "\n";
610 generateDocumentation(o
, options
, manager
, u2b(rIface
.name
), delegate
);
612 o
<< "\n// properties of service \""<< name
<< "\"\n";
613 for (const auto& rProp
: entity
->getDirectProperties())
616 printType(o
, options
, manager
, rProp
.type
, false);
618 << codemaker::java::translateUnoToJavaIdentifier(
619 u2b(rProp
.name
), "property")
624 static void printMapsToJavaType(
625 std::ostream
& o
, ProgramOptions
const & options
,
626 rtl::Reference
< TypeManager
> const & manager
,
627 codemaker::UnoType::Sort sort
, std::u16string_view nucleus
, sal_Int32 rank
,
628 std::vector
< OUString
> const & arguments
, const char * javaTypeSort
)
630 o
<< "maps to Java 1.5 ";
631 if (javaTypeSort
!= nullptr) {
632 o
<< javaTypeSort
<< ' ';
635 if (rank
== 0 && nucleus
== u
"com.sun.star.uno.XInterface") {
636 o
<< "com.sun.star.uno.XInterface";
639 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, false, false);
644 void generateDocumentation(std::ostream
& o
,
645 ProgramOptions
const & options
, rtl::Reference
< TypeManager
> const & manager
,
646 OString
const & type
, OString
const & delegate
)
650 codemaker::UnoType::Sort sort
= manager
->decompose(
651 b2u(type
), false, &nucleus
, &rank
, nullptr, nullptr);
654 if (!delegate
.isEmpty()) {
655 if (sort
!= codemaker::UnoType::Sort::Interface
&&
656 sort
!= codemaker::UnoType::Sort::SingleInterfaceBasedService
&&
657 sort
!= codemaker::UnoType::Sort::AccumulationBasedService
)
667 o
<< " sequence type";
668 } else if (sort
<= codemaker::UnoType::Sort::Any
) {
672 case codemaker::UnoType::Sort::Interface
:
673 o
<< " interface type";
676 case codemaker::UnoType::Sort::Module
:
680 case codemaker::UnoType::Sort::PlainStruct
:
681 o
<< " simple struct type";
684 case codemaker::UnoType::Sort::PolymorphicStructTemplate
:
685 o
<< " polymorphic struct type template";
688 case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct
:
689 o
<< " instantiated polymorphic struct type";
692 case codemaker::UnoType::Sort::Enum
:
696 case codemaker::UnoType::Sort::Exception
:
697 o
<< " exception type";
700 case codemaker::UnoType::Sort::Typedef
:
704 case codemaker::UnoType::Sort::SingleInterfaceBasedService
:
705 o
<< " single-inheritance--based service";
708 case codemaker::UnoType::Sort::AccumulationBasedService
:
709 o
<< "IDL accumulation-based service";
712 case codemaker::UnoType::Sort::InterfaceBasedSingleton
:
713 o
<< " inheritance-based singleton";
716 case codemaker::UnoType::Sort::ServiceBasedSingleton
:
717 o
<< "IDL service-based singleton";
720 case codemaker::UnoType::Sort::ConstantGroup
:
721 o
<< "IDL constant group";
729 o
<< " \"" << type
<< "\" ";
731 std::vector
< OUString
> arguments
;
732 rtl::Reference
< unoidl::Entity
> entity
;
733 sort
= manager
->decompose(
734 b2u(type
), true, &nucleus
, &rank
, &arguments
, &entity
);
737 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "array");
739 } else if (sort
<= codemaker::UnoType::Sort::Any
) {
741 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, nullptr);
745 case codemaker::UnoType::Sort::Interface
:
747 o
, options
, manager
, sort
, nucleus
, rank
, arguments
,
749 if (nucleus
== "com.sun.star.uno.XInterface") {
752 o
<< "; " << (options
.all
? "all" : "direct") << " methods:\n";
753 codemaker::GeneratedTypeSet generated
;
755 o
, options
, manager
, nucleus
, generated
, delegate
, ""_ostr
);
759 case codemaker::UnoType::Sort::Module
:
761 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "package");
765 case codemaker::UnoType::Sort::PlainStruct
:
767 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "class");
768 o
<< "; full constructor:\n";
770 o
, options
, manager
, codemaker::UnoType::Sort::PlainStruct
,
771 entity
, nucleus
, arguments
);
774 case codemaker::UnoType::Sort::PolymorphicStructTemplate
:
776 o
, options
, manager
, sort
, nucleus
, rank
, arguments
,
778 o
<< "; full constructor:\n";
781 codemaker::UnoType::Sort::PolymorphicStructTemplate
,
782 entity
, nucleus
, arguments
);
785 case codemaker::UnoType::Sort::InstantiatedPolymorphicStruct
:
787 o
, options
, manager
, sort
, nucleus
, rank
, arguments
,
788 "generic class instantiation");
789 o
<< "; full constructor:\n";
792 codemaker::UnoType::Sort::InstantiatedPolymorphicStruct
,
793 entity
, nucleus
, arguments
);
796 case codemaker::UnoType::Sort::Enum
:
797 case codemaker::UnoType::Sort::ConstantGroup
:
799 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "class");
803 case codemaker::UnoType::Sort::Exception
:
805 o
, options
, manager
, sort
, nucleus
, rank
, arguments
,
807 o
<< "; full constructor:\n";
809 o
, options
, manager
, codemaker::UnoType::Sort::Exception
,
810 entity
, nucleus
, arguments
);
813 case codemaker::UnoType::Sort::SingleInterfaceBasedService
:
815 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "class");
816 o
<< "; construction methods:\n";
817 printConstructors(o
, options
, manager
, nucleus
);
818 generateDocumentation(
820 u2b(dynamic_cast< unoidl::SingleInterfaceBasedServiceEntity
& >(
825 case codemaker::UnoType::Sort::AccumulationBasedService
:
826 o
<< ("does not map to Java\n"
827 "// the service members are generated instead\n");
829 o
, options
, manager
, nucleus
,
830 dynamic_cast< unoidl::AccumulationBasedServiceEntity
* >(
835 case codemaker::UnoType::Sort::InterfaceBasedSingleton
:
837 o
, options
, manager
, sort
, nucleus
, rank
, arguments
, "class");
838 o
<< "; get method:\npublic static ";
841 dynamic_cast< unoidl::InterfaceBasedSingletonEntity
& >(
844 o
<< " get(com.sun.star.uno.XComponentContext context);\n";
847 case codemaker::UnoType::Sort::ServiceBasedSingleton
:
848 o
<< "does not map to Java\n";
861 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */