1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "codemaker/commonjava.hxx"
31 #include "ostringostreaminserter.hxx"
32 #include "skeletoncommon.hxx"
33 #include "skeletonjava.hxx"
35 using namespace ::rtl
;
37 namespace skeletonmaker
{ namespace java
{
39 void printType(std::ostream
& o
,
40 ProgramOptions
const & options
, TypeManager
const & manager
,
41 OString
const & type
, bool referenceType
,
44 void printType(std::ostream
& o
,
45 ProgramOptions
const & options
, TypeManager
const & manager
,
46 codemaker::UnoType::Sort sort
, RTTypeClass typeClass
,
47 OString
const & name
, sal_Int32 rank
,
48 std::vector
< OString
> const & arguments
, bool referenceType
,
51 if ( defaultvalue
&& rank
== 0 && sort
<= codemaker::UnoType::SORT_CHAR
) {
54 case codemaker::UnoType::SORT_BOOLEAN
:
57 case codemaker::UnoType::SORT_CHAR
:
58 case codemaker::UnoType::SORT_BYTE
:
59 case codemaker::UnoType::SORT_SHORT
:
60 case codemaker::UnoType::SORT_UNSIGNED_SHORT
:
61 case codemaker::UnoType::SORT_LONG
:
62 case codemaker::UnoType::SORT_UNSIGNED_LONG
:
63 case codemaker::UnoType::SORT_HYPER
:
64 case codemaker::UnoType::SORT_UNSIGNED_HYPER
:
65 case codemaker::UnoType::SORT_FLOAT
:
66 case codemaker::UnoType::SORT_DOUBLE
:
69 case codemaker::UnoType::SORT_VOID
:
70 case codemaker::UnoType::SORT_STRING
:
71 case codemaker::UnoType::SORT_TYPE
:
72 case codemaker::UnoType::SORT_ANY
:
73 case codemaker::UnoType::SORT_COMPLEX
:
79 if ( sort
== codemaker::UnoType::SORT_COMPLEX
&&
80 typeClass
== RT_TYPE_INTERFACE
) {
83 } else if ( sort
== codemaker::UnoType::SORT_ANY
&& rank
==0 ) {
84 o
<< "com.sun.star.uno.Any.VOID";
86 } else if ( sort
== codemaker::UnoType::SORT_TYPE
&& rank
==0 ) {
87 o
<< "com.sun.star.uno.Type.VOID";
90 if ( typeClass
!= RT_TYPE_ENUM
|| rank
> 0 )
94 OString
sType(codemaker::java::translateUnoToJavaType(
95 sort
, typeClass
, name
, referenceType
&& rank
==0).replace('/', '.'));
96 if ( sType
.indexOf("java.lang.") == 0 )
97 sType
= sType
.copy(10);
99 if ( !arguments
.empty() && options
.java5
) {
101 for ( std::vector
< OString
>::const_iterator
i(arguments
.begin());
102 i
!= arguments
.end(); ++i
)
104 if ( i
!= arguments
.begin() ) {
108 printType(o
, options
, manager
, *i
, true, false);
112 for ( sal_Int32 i
= 0; i
< rank
; ++i
) {
119 if ( defaultvalue
&& sort
> codemaker::UnoType::SORT_CHAR
&& rank
== 0 ) {
120 if ( typeClass
== RT_TYPE_ENUM
)
121 o
<< ".getDefault()";
127 void printType(std::ostream
& o
,
128 ProgramOptions
const & options
, TypeManager
const & manager
,
129 OString
const & type
, bool referenceType
, bool defaultvalue
)
131 RTTypeClass typeClass
;
134 std::vector
< OString
> arguments
;
135 codemaker::UnoType::Sort sort
= codemaker::decomposeAndResolve(
136 manager
, type
, true, true, true, &typeClass
, &name
, &rank
, &arguments
);
138 options
, manager
, sort
, typeClass
, name
, rank
, arguments
,
139 referenceType
, defaultvalue
);
142 bool printConstructorParameters(std::ostream
& o
,
143 ProgramOptions
const & options
, TypeManager
const & manager
,
144 typereg::Reader
const & reader
, typereg::Reader
const & outerReader
,
145 std::vector
< OString
> const & arguments
)
147 bool previous
= false;
148 if ( reader
.getSuperTypeCount() != 0 ) {
150 codemaker::convertString(reader
.getSuperTypeName(0)));
151 typereg::Reader
superReader(manager
.getTypeReader(super
));
152 if ( !superReader
.isValid() ) {
153 throw CannotDumpException("Bad type library entity " + super
);
155 previous
= printConstructorParameters(o
,
156 options
, manager
, superReader
, outerReader
, arguments
);
158 for ( sal_uInt16 i
= 0; i
< reader
.getFieldCount(); ++i
) {
163 if ( (reader
.getFieldFlags(i
) & RT_ACCESS_PARAMETERIZED_TYPE
) == 0 ) {
166 codemaker::convertString(reader
.getFieldTypeName(i
)),
168 } else if ( arguments
.empty() ) {
169 o
<< "java.lang.Object";
171 sal_uInt16 tparam
= 0;
172 while ( outerReader
.getReferenceTypeName(tparam
)
173 != reader
.getFieldTypeName(i
) )
176 OSL_ASSERT(tparam
< outerReader
.getReferenceCount());
178 // assume std::vector< OString >::size_type is at least as
179 // large as sal_uInt16:
180 printType(o
, options
, manager
, arguments
[tparam
], true);
184 << (codemaker::java::translateUnoToJavaIdentifier(
185 codemaker::convertString(reader
.getFieldName(i
)),
192 void printConstructor(std::ostream
& o
,
193 ProgramOptions
const & options
, TypeManager
const & manager
,
194 typereg::Reader
const & reader
,
195 std::vector
< OString
> const & arguments
)
197 OString
type(codemaker::convertString(reader
.getTypeName()));
198 o
<< "public " << type
.copy(type
.lastIndexOf('/') + 1) << '(';
199 printConstructorParameters(o
, options
, manager
, reader
, reader
, arguments
);
203 void printMethodParameters(std::ostream
& o
,
204 ProgramOptions
const & options
, TypeManager
const & manager
,
205 typereg::Reader
const & reader
, sal_uInt16 method
, bool previous
,
208 for ( sal_uInt16 i
= 0; i
< reader
.getMethodParameterCount(method
); ++i
) {
215 printType(o
, options
, manager
,
216 codemaker::convertString(
217 reader
.getMethodParameterTypeName(method
, i
)),
219 if ( reader
.getMethodParameterFlags(method
, i
) == RT_PARAM_OUT
220 || reader
.getMethodParameterFlags(method
, i
) == RT_PARAM_INOUT
)
223 } else if ( (reader
.getMethodParameterFlags(method
, i
) & RT_PARAM_REST
)
226 o
<< (options
.java5
? "..." : "[]");
230 o
<< (codemaker::java::translateUnoToJavaIdentifier(
231 codemaker::convertString(
232 reader
.getMethodParameterName(method
, i
)),
238 void printExceptionSpecification(std::ostream
& o
,
239 ProgramOptions
const & options
, TypeManager
const & manager
,
240 typereg::Reader
const & reader
, sal_uInt16 method
)
242 if ( reader
.getMethodExceptionCount(method
) > 0 ) {
244 for ( sal_uInt16 i
= 0; i
< reader
.getMethodExceptionCount(method
); ++i
)
251 codemaker::convertString(
252 reader
.getMethodExceptionTypeName(method
, i
)),
259 void printSetPropertyMixinBody(std::ostream
& o
,
260 typereg::Reader
const & reader
,
263 OString
const & indentation
)
265 RTFieldAccess propFlags
= checkAdditionalPropertyFlags(reader
, field
, method
);
266 OString fieldname
= codemaker::convertString(reader
.getFieldName(field
));
267 bool bound
= (reader
.getFieldFlags(field
) & RT_ACCESS_BOUND
? true : false);
269 o
<< "\n" << indentation
<< "{\n";
272 o
<< indentation
<< " PropertySetMixin.BoundListeners l = "
273 "new PropertySetMixin.BoundListeners();\n\n";
276 o
<< indentation
<< " m_prophlp.prepareSet(\""
277 << fieldname
<< "\", ";
278 if ( propFlags
& RT_ACCESS_CONSTRAINED
) {
279 OString fieldtype
= codemaker::convertString(reader
.getFieldTypeName(field
));
281 sal_Int32 index
= fieldtype
.lastIndexOf('<');
284 bool optional
= false;
285 OStringBuffer
buffer1(64);
286 OStringBuffer
buffer2(64);
289 OString
s(fieldtype
.getToken(0, '<', nPos
));
290 OStringBuffer
buffer(16);
292 buffer
.append(s
.copy(s
.lastIndexOf('/')+1));
294 OString t
= buffer
.makeStringAndClear();
296 if ( t
.equals("((Optional)") ) {
300 buffer1
.append("the_value.IsPresent");
301 buffer2
.append("the_value.Value");
303 buffer1
.insert(0, t
);
304 buffer1
.append(").IsPresent");
305 buffer2
.insert(0, t
);
306 buffer2
.append(").Value");
312 buffer1
.append("the_value.Value");
314 buffer2
.append("the_value.Value");
317 buffer1
.insert(0, t
);
318 buffer1
.append(").Value");
320 buffer2
.insert(0, t
);
321 buffer2
.append(").Value");
324 } while( nPos
<= index
);
326 o
<< "Any.VOID,\n" << indentation
<< " ";
329 o
<< buffer1
.makeStringAndClear();
331 o
<< ") ? " << buffer2
.makeStringAndClear() << " : Any.VOID,\n"
332 << indentation
<< " ";
343 o
<< indentation
<< " synchronized (this) {\n"
344 << indentation
<< " m_" << fieldname
345 << " = the_value;\n" << indentation
<< " }\n";
348 o
<< indentation
<< " l.notifyListeners();\n";
350 o
<< indentation
<< "}\n\n";
353 void generateXPropertySetBodies(std::ostream
& o
);
354 void generateXFastPropertySetBodies(std::ostream
& o
);
355 void generateXPropertyAccessBodies(std::ostream
& o
);
357 void printMethods(std::ostream
& o
,
358 ProgramOptions
const & options
, TypeManager
const & manager
,
359 typereg::Reader
const & reader
,
360 codemaker::GeneratedTypeSet
& generated
,
361 OString
const & delegate
, OString
const & indentation
,
362 bool defaultvalue
, bool usepropertymixin
)
364 OString
type(codemaker::convertString(reader
.getTypeName()));
365 if ( generated
.contains(type
) || type
== "com/sun/star/uno/XInterface" ||
367 ( type
.equals("com/sun/star/lang/XComponent") ||
368 type
.equals("com/sun/star/lang/XTypeProvider") ||
369 type
.equals("com/sun/star/uno/XWeak") ) ) ) {
373 if ( usepropertymixin
) {
374 if ( type
.equals("com/sun/star/beans/XPropertySet") ) {
376 generateXPropertySetBodies(o
);
378 } else if ( type
.equals("com/sun/star/beans/XFastPropertySet") ) {
380 generateXFastPropertySetBodies(o
);
382 } else if ( type
.equals("com/sun/star/beans/XPropertyAccess") ) {
384 generateXPropertyAccessBodies(o
);
389 static OString
sd(RTL_CONSTASCII_STRINGPARAM("_"));
390 bool body
= !delegate
.isEmpty();
391 bool defaultbody
= ((delegate
.equals(sd
)) ? true : false);
394 if ( options
.all
|| defaultvalue
) {
395 for (sal_uInt16 i
= 0; i
< reader
.getSuperTypeCount(); ++i
) {
396 typereg::Reader
super(
397 manager
.getTypeReader(
398 codemaker::convertString(
399 reader
.getSuperTypeName(i
))));
400 if ( !super
.isValid() ) {
401 throw CannotDumpException(
402 "Bad type library entity "
403 + codemaker::convertString(
404 reader
.getSuperTypeName(i
)));
406 printMethods(o
, options
, manager
, super
, generated
, delegate
,
407 indentation
, defaultvalue
, usepropertymixin
);
409 if ( reader
.getFieldCount() > 0 || reader
.getMethodCount() > 0 ) {
410 o
<< indentation
<< "// ";
411 printType(o
, options
, manager
, type
, false);
415 sal_uInt16 method
= 0;
416 for ( sal_uInt16 i
= 0; i
< reader
.getFieldCount(); ++i
) {
417 // OString fieldName(
418 // codemaker::convertString(reader.getFieldName(i)).
419 // replace('/', '.'));
420 // OString fieldType(
421 // codemaker::convertString(reader.getFieldTypeName(i)).
422 // replace('/', '.'));
423 // attributes.insert(StringPairHashMap::value_type(fieldName,
424 // std::pair<OString, sal_Int16>(
425 // fieldType, reader.getFieldFlags(i))));
427 o
<< indentation
<< "public ";
430 codemaker::convertString(reader
.getFieldTypeName(i
)), false);
432 << codemaker::convertString(reader
.getFieldName(i
)).getStr()
435 OUString mn
= reader
.getMethodName(method
);
436 OUString fn
= reader
.getFieldName(i
);
438 if ( method
< reader
.getMethodCount()
439 && reader
.getMethodFlags(method
) == RT_MODE_ATTRIBUTE_GET
440 && reader
.getMethodName(method
) == reader
.getFieldName(i
) )
442 printExceptionSpecification(o
, options
, manager
, reader
, method
++);
446 if ( usepropertymixin
) {
447 o
<< "\n" << indentation
<< "{\n" << indentation
449 << codemaker::convertString(reader
.getFieldName(i
)).getStr()
450 << ";\n" << indentation
<< "}\n\n";
452 o
<< "\n" << indentation
<< "{\n" << indentation
456 codemaker::convertString(reader
.getFieldTypeName(i
)),
458 o
<< ";\n" << indentation
<< "}\n\n";
461 o
<< "\n" << indentation
<< "{\n" << indentation
<<
463 << delegate
.getStr() << "get"
464 << codemaker::convertString(reader
.getFieldName(i
)).getStr()
465 << "();\n" << indentation
<< "}\n\n";
472 OUString tmp
= reader
.getFieldName(i
);
473 bool setAttrMethod
= false;
474 if ( (reader
.getFieldFlags(i
) & RT_ACCESS_READONLY
) == 0 ) {
475 o
<< indentation
<< "public void set"
476 << (codemaker::convertString(reader
.getFieldName(i
)).
481 codemaker::convertString(reader
.getFieldTypeName(i
)),
484 if ( method
< reader
.getMethodCount()
485 && reader
.getMethodFlags(method
) == RT_MODE_ATTRIBUTE_SET
486 && reader
.getMethodName(method
) == reader
.getFieldName(i
) )
489 printExceptionSpecification(o
, options
, manager
, reader
, method
);
493 if ( usepropertymixin
) {
494 printSetPropertyMixinBody(o
, reader
, i
, method
,
497 o
<< "\n" << indentation
<< "{\n\n" << indentation
501 o
<< "\n" << indentation
<< "{\n" << indentation
502 << " " << delegate
.getStr() << "set"
503 << codemaker::convertString(reader
.getFieldName(i
)).getStr()
504 << "(the_value);\n" << indentation
<< "}\n\n";
509 if (setAttrMethod
) ++method
;
512 for ( ; method
< reader
.getMethodCount(); ++method
) {
513 o
<< indentation
<< "public ";
516 codemaker::convertString(
517 reader
.getMethodReturnTypeName(method
)),
520 const OString
methodName(codemaker::convertString(reader
.getMethodName(method
)));
522 o
<< ' ' << methodName
.getStr() << '(';
523 printMethodParameters(o
, options
, manager
, reader
, method
, false, true);
525 printExceptionSpecification(o
, options
, manager
, reader
, method
);
527 static OUString
s(RTL_CONSTASCII_USTRINGPARAM("void"));
529 o
<< "\n" << indentation
<< "{\n";
530 if ( !reader
.getMethodReturnTypeName(method
).equals(s
) ) {
531 o
<< indentation
<< " // TODO: Exchange the default return "
532 << "implementation for \"" << methodName
<< "\" !!!\n";
533 o
<< indentation
<< " // NOTE: "
534 "Default initialized polymorphic structs can cause problems"
535 "\n" << indentation
<< " // because of missing default "
536 "initialization of primitive types of\n" << indentation
537 << " // some C++ compilers or different Any initialization"
538 " in Java and C++\n" << indentation
539 << " // polymorphic structs.\n" << indentation
543 codemaker::convertString(
544 reader
.getMethodReturnTypeName(method
)),
548 o
<< indentation
<< " // TODO: Insert your implementation for \""
549 << methodName
<< "\" here.";
551 o
<< "\n" << indentation
<< "}\n\n";
553 o
<< "\n" << indentation
<< "{\n" << indentation
<< " ";
554 if ( !reader
.getMethodReturnTypeName(method
).equals(s
) )
556 o
<< delegate
.getStr()
557 << (codemaker::convertString(
558 reader
.getMethodName(method
)).getStr())
560 printMethodParameters(o
, options
, manager
, reader
, method
,
562 o
<< ");\n" << indentation
<< "}\n\n";
570 void printConstructionMethods(std::ostream
& o
,
571 ProgramOptions
const & options
, TypeManager
const & manager
,
572 typereg::Reader
const & reader
)
574 for ( sal_uInt16 i
= 0; i
< reader
.getMethodCount(); ++i
) {
575 o
<< "public static ";
578 codemaker::convertString(reader
.getSuperTypeName(0)), false);
580 if ( reader
.getMethodName(i
).isEmpty() ) {
583 o
<< (codemaker::java::translateUnoToJavaIdentifier(
584 codemaker::convertString(reader
.getMethodName(i
)),
587 o
<< "(com.sun.star.uno.XComponentContext the_context";
588 printMethodParameters(o
, options
, manager
, reader
, i
, true, true);
590 printExceptionSpecification(o
, options
, manager
, reader
, i
);
595 void generateDocumentation(std::ostream
& o
,
596 ProgramOptions
const & options
, TypeManager
const & manager
,
597 OString
const & type
);
599 void printServiceMembers(std::ostream
& o
,
600 ProgramOptions
const & options
, TypeManager
const & manager
,
601 typereg::Reader
const & reader
, OString
const & type
,
602 OString
const & delegate
)
604 for ( sal_uInt16 i
= 0; i
< reader
.getReferenceCount(); ++i
) {
605 OString
referenceType(
606 codemaker::convertString(
607 reader
.getReferenceTypeName(i
)).replace('/', '.'));
609 if ( reader
.getReferenceSort(i
) == RT_REF_SUPPORTS
) {
610 o
<< "\n// supported interface " << referenceType
.getStr() << "\n";
611 generateDocumentation(o
, options
, manager
, referenceType
, delegate
);
612 } else if ( reader
.getReferenceSort(i
) == RT_REF_EXPORTS
) {
613 o
<< "\n// exported service " << referenceType
.getStr() << "\n";
614 generateDocumentation(o
, options
, manager
, referenceType
, delegate
);
618 o
<< "\n// properties of service \""<< type
.getStr() << "\"\n";
619 for ( sal_uInt16 i
= 0; i
< reader
.getFieldCount(); ++i
) {
621 codemaker::convertString(reader
.getFieldName(i
)));
623 codemaker::convertString(reader
.getFieldTypeName(i
)));
626 printType(o
, options
, manager
, fieldType
, false);
628 << codemaker::java::translateUnoToJavaIdentifier(
629 fieldName
, "property").getStr()
634 void printMapsToJavaType(std::ostream
& o
,
635 ProgramOptions
const & options
, TypeManager
const & manager
,
636 codemaker::UnoType::Sort sort
, RTTypeClass typeClass
,
637 OString
const & name
, sal_Int32 rank
,
638 std::vector
< OString
> const & arguments
, const char * javaTypeSort
)
640 o
<< "maps to Java " << (options
.java5
? "1.5" : "1.4") << " ";
641 if ( javaTypeSort
!= 0 ) {
642 o
<< javaTypeSort
<< ' ';
645 if ( rank
== 0 && name
== "com/sun/star/uno/XInterface" ) {
646 o
<< "com.sun.star.uno.XInterface";
649 options
, manager
, sort
, typeClass
, name
, rank
, arguments
, false);
654 void generateDocumentation(std::ostream
& o
,
655 ProgramOptions
const & options
, TypeManager
const & manager
,
656 OString
const & type
, OString
const & delegate
)
658 if ( type
.indexOf('/') >= 0 ) {
659 throw CannotDumpException("Illegal type name " + type
);
661 OString
binType(type
.replace('.', '/'));
662 RTTypeClass typeClass
;
665 std::vector
< OString
> arguments
;
666 codemaker::UnoType::Sort sort
= decomposeResolveAndCheck(
667 manager
, binType
, false, true, true, &typeClass
, &name
, &rank
,
671 if ( !delegate
.isEmpty() ) {
672 if ( typeClass
!= RT_TYPE_INTERFACE
&& typeClass
!= RT_TYPE_SERVICE
)
681 o
<< " sequence type";
682 } else if ( sort
!= codemaker::UnoType::SORT_COMPLEX
) {
685 typereg::Reader
reader(manager
.getTypeReader(name
));
686 if ( !reader
.isValid() ) {
687 throw CannotDumpException("Bad type library entity " + name
);
689 switch ( typeClass
) {
690 case RT_TYPE_INTERFACE
:
691 o
<< " interface type";
699 if ( reader
.getReferenceCount() == 0 ) {
700 o
<< " simple struct type";
701 } else if ( arguments
.empty() ) {
702 o
<< " polymorphic struct type template";
704 o
<< " instantiated polymorphic struct type";
712 case RT_TYPE_EXCEPTION
:
713 o
<< " exception type";
716 case RT_TYPE_TYPEDEF
:
720 case RT_TYPE_SERVICE
:
721 if ( reader
.getSuperTypeCount() > 0 ) {
722 o
<< " single-inheritance--based service";
724 o
<< "IDL accumulation-based service";
728 case RT_TYPE_SINGLETON
:
729 if ( (manager
.getTypeReader(
730 codemaker::convertString(
731 reader
.getSuperTypeName(0))).getTypeClass())
732 == RT_TYPE_INTERFACE
)
734 o
<< " inheritance-based singleton";
736 o
<< "IDL service-based singleton";
740 case RT_TYPE_CONSTANTS
:
741 o
<< "IDL constant group";
749 o
<< " \"" << type
.getStr() << "\" ";
751 sort
= codemaker::decomposeAndResolve(
752 manager
, binType
, true, true, true, &typeClass
, &name
, &rank
,
755 printMapsToJavaType(o
,
756 options
, manager
, sort
, typeClass
, name
, rank
, arguments
, "array");
758 } else if ( sort
!= codemaker::UnoType::SORT_COMPLEX
) {
759 printMapsToJavaType(o
,
760 options
, manager
, sort
, typeClass
, name
, rank
, arguments
, 0);
763 typereg::Reader
reader(manager
.getTypeReader(name
));
764 if ( !reader
.isValid() ) {
765 throw CannotDumpException("Bad type library entity " + name
);
767 switch ( typeClass
) {
768 case RT_TYPE_INTERFACE
:
769 printMapsToJavaType(o
,
770 options
, manager
, sort
, typeClass
, name
, rank
, arguments
,
772 if ( name
== "com/sun/star/uno/XInterface" ) {
776 << "; " << (options
.all
? "all" : "direct")
778 codemaker::GeneratedTypeSet generated
;
779 printMethods(o
, options
, manager
, reader
, generated
,
785 printMapsToJavaType(o
,
786 options
, manager
, sort
, typeClass
, name
, rank
, arguments
,
792 if ( reader
.getReferenceCount() == 0 ) {
793 printMapsToJavaType(o
,
794 options
, manager
, sort
, typeClass
, name
, rank
, arguments
,
796 } else if ( arguments
.empty() ) {
797 printMapsToJavaType(o
,
798 options
, manager
, sort
, typeClass
, name
, rank
, arguments
,
799 options
.java5
? "generic class" : "class");
801 printMapsToJavaType(o
,
802 options
, manager
, sort
, typeClass
, name
, rank
, arguments
,
803 options
.java5
? "generic class instantiation" : "class");
805 o
<< "; full constructor:\n";
806 printConstructor(o
, options
, manager
, reader
, arguments
);
810 case RT_TYPE_CONSTANTS
:
811 printMapsToJavaType(o
,
812 options
, manager
, sort
, typeClass
, name
, rank
, arguments
,
817 case RT_TYPE_EXCEPTION
:
818 printMapsToJavaType(o
,
819 options
, manager
, sort
, typeClass
, name
, rank
, arguments
,
821 o
<< "; full constructor:\n";
822 printConstructor(o
, options
, manager
, reader
, arguments
);
825 case RT_TYPE_SERVICE
:
826 if ( reader
.getSuperTypeCount() > 0 ) {
827 printMapsToJavaType(o
,
828 options
, manager
, sort
, typeClass
, name
, rank
, arguments
,
830 o
<< "; construction methods:\n";
831 printConstructionMethods(o
, options
, manager
, reader
);
834 codemaker::convertString(
835 reader
.getSuperTypeName(0)).replace('/', '.'));
837 generateDocumentation(o
, options
, manager
, super
, delegate
);
839 o
<< ("does not map to Java\n"
840 "// the service members are generated instead\n");
841 printServiceMembers(o
, options
, manager
, reader
, type
, delegate
);
845 case RT_TYPE_SINGLETON
:
846 if ( reader
.getSuperTypeCount() > 0 &&
847 ((manager
.getTypeReader(
848 codemaker::convertString(
849 reader
.getSuperTypeName(0))).getTypeClass())
850 == RT_TYPE_INTERFACE
) ) {
851 printMapsToJavaType(o
, options
, manager
, sort
, typeClass
,
852 name
, rank
, arguments
, "class");
853 o
<< "; get method:\npublic static ";
854 printType(o
, options
, manager
,
855 codemaker::convertString(reader
.getSuperTypeName(0)),
858 << " get(com.sun.star.uno.XComponentContext context);\n";
860 o
<< "does not map to Java\n";
874 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */