summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--registry/source/reflread.cxx8
-rw-r--r--registry/source/reflwrit.cxx10
-rw-r--r--registry/source/regimpl.cxx58
-rw-r--r--registry/source/registry.cxx51
-rw-r--r--registry/tools/checksingleton.cxx5
-rw-r--r--remotebridges/source/dynamicloader/dynamicloader.xml2
-rw-r--r--remotebridges/source/unourl_resolver/makefile.mk8
-rw-r--r--ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java216
-rw-r--r--ridljar/com/sun/star/uno/Any.java21
-rw-r--r--ridljar/com/sun/star/uno/ITypeDescription.java79
-rw-r--r--ridljar/com/sun/star/uno/Type.java359
-rw-r--r--ridljar/prj/build.lst4
-rw-r--r--ridljar/prj/d.lst2
-rw-r--r--ridljar/util/delzip0
-rw-r--r--ridljar/util/makefile.mk17
15 files changed, 484 insertions, 356 deletions
diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx
index 19d387961..1149cab15 100644
--- a/registry/source/reflread.cxx
+++ b/registry/source/reflread.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: reflread.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: mh $ $Date: 2002-04-23 14:30:19 $
+ * last change: $Author: hr $ $Date: 2003-03-26 15:37:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,10 +89,6 @@ const sal_uInt16 majorVersion = 0x0001;
ORealDynamicLoader* ODynamicLoader<RegistryTypeReader_Api>::m_pLoader = NULL;
#endif
-#if defined(MACOSX)
-ORealDynamicLoader* ODynamicLoader<RegistryTypeReader_Api>::m_pStaticLoader = NULL;
-#endif
-
/**************************************************************************
class BlopObject
diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index c295181dc..155d0ffb5 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: reflwrit.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: mh $ $Date: 2002-04-23 14:30:19 $
+ * last change: $Author: hr $ $Date: 2003-03-26 15:37:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,7 +80,7 @@ using namespace rtl;
using namespace salhelper;
#ifdef MAC
-#define strdup(str) strcpy((sal_Char*)malloc(strlen(str)+1),str)
+#define strdup(str) strcpy((sal_Char*)malloc(strlen(str)+1),str) /* #100211# - checked */
#endif
static sal_Char NULL_STRING[1] = { 0 };
@@ -90,10 +90,6 @@ static sal_Unicode NULL_WSTRING[1] = { 0 };
ORealDynamicLoader* ODynamicLoader<RegistryTypeWriter_Api>::m_pLoader = NULL;
#endif
-#if defined(MACOSX)
-ORealDynamicLoader* ODynamicLoader<RegistryTypeWriter_Api>::m_pStaticLoader = NULL;
-#endif
-
#define BLOP_OFFSET_MAGIC 0
#define BLOP_OFFSET_SIZE (BLOP_OFFSET_MAGIC + sizeof(sal_uInt32))
#define BLOP_OFFSET_MINOR (BLOP_OFFSET_SIZE + sizeof(sal_uInt32))
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
index 72e724acf..21de911ad 100644
--- a/registry/source/regimpl.cxx
+++ b/registry/source/regimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: regimpl.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: jbu $ $Date: 2002-11-12 16:22:19 $
+ * last change: $Author: hr $ $Date: 2003-03-26 15:37:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -63,7 +63,7 @@
#include <stdio.h>
#ifdef MAC
#include <unistd.h>
-#define strdup(str) strcpy((sal_Char*)malloc(strlen(str)+1),str)
+#define strdup(str) strcpy((sal_Char*)malloc(strlen(str)+1),str) /* #100211# - checked */
#endif
#ifdef UNX
#include <unistd.h>
@@ -196,9 +196,9 @@ static sal_Bool dumpType(RegistryTypeReader& reader, const OString& sIndent)
for (i = 0; i < reader.getFieldCount(); i++)
{
fprintf(stdout, "%sfield #%d:\n%s name='%s'\n%s type='%s'\n", indent,
- i, indent, OUStringToOString(reader.getFieldName(i), RTL_TEXTENCODING_UTF8).getStr(),
+ i, indent, OUStringToOString(reader.getFieldName(i), RTL_TEXTENCODING_UTF8).getStr(),
indent, OUStringToOString(reader.getFieldType(i), RTL_TEXTENCODING_UTF8).getStr());
-
+
fieldAccess = reader.getFieldAccess(i);
if ( fieldAccess == RT_ACCESS_INVALID )
{
@@ -313,7 +313,7 @@ static sal_Bool dumpType(RegistryTypeReader& reader, const OString& sIndent)
break;
}
}
-
+
fprintf(stdout, "\n%s Doku: \"%s\"", indent, OUStringToOString(reader.getFieldDoku(i), RTL_TEXTENCODING_UTF8).getStr());
fprintf(stdout, "\n%s IDL source file: \"%s\"\n", indent, OUStringToOString(reader.getFieldFileName(i), RTL_TEXTENCODING_UTF8).getStr());
}
@@ -343,9 +343,9 @@ static sal_Bool dumpType(RegistryTypeReader& reader, const OString& sIndent)
fprintf(stdout, "<unknown mode> ");
break;
}
-
- fprintf(stdout, "%s %s(",
- OUStringToOString(reader.getMethodReturnType(i), RTL_TEXTENCODING_UTF8).getStr(),
+
+ fprintf(stdout, "%s %s(",
+ OUStringToOString(reader.getMethodReturnType(i), RTL_TEXTENCODING_UTF8).getStr(),
OUStringToOString(reader.getMethodName(i), RTL_TEXTENCODING_UTF8).getStr());
for (j = 0; j < reader.getMethodParamCount(i); j++)
@@ -369,8 +369,8 @@ static sal_Bool dumpType(RegistryTypeReader& reader, const OString& sIndent)
break;
}
- fprintf(stdout, "%s %s",
- OUStringToOString(reader.getMethodParamType(i, j), RTL_TEXTENCODING_UTF8).getStr(),
+ fprintf(stdout, "%s %s",
+ OUStringToOString(reader.getMethodParamType(i, j), RTL_TEXTENCODING_UTF8).getStr(),
OUStringToOString(reader.getMethodParamName(i, j), RTL_TEXTENCODING_UTF8).getStr());
if (j != reader.getMethodParamCount(i) - 1)
@@ -384,21 +384,21 @@ static sal_Bool dumpType(RegistryTypeReader& reader, const OString& sIndent)
fprintf(stdout, "raises ");
for (j = 0; j < reader.getMethodExcCount(i); j++)
{
- fprintf(stdout, "%s",
+ fprintf(stdout, "%s",
OUStringToOString(reader.getMethodExcType(i, j), RTL_TEXTENCODING_UTF8).getStr());
if (j != reader.getMethodExcCount(i) - 1)
fprintf(stdout, ", ");
}
}
- fprintf(stdout, "\n%s Doku: \"%s\"\n", indent,
+ fprintf(stdout, "\n%s Doku: \"%s\"\n", indent,
OUStringToOString(reader.getMethodDoku(i), RTL_TEXTENCODING_UTF8).getStr());
}
fprintf(stdout, "%snumber of references: %d\n", indent, reader.getReferenceCount());
for (i = 0; i < reader.getReferenceCount(); i++)
{
- fprintf(stdout, "%sreference #%d:\n%s name='%s'\n", indent, i, indent,
+ fprintf(stdout, "%sreference #%d:\n%s name='%s'\n", indent, i, indent,
OUStringToOString(reader.getReferenceName(i), RTL_TEXTENCODING_UTF8).getStr());
switch (reader.getReferenceType(i))
{
@@ -426,7 +426,7 @@ static sal_Bool dumpType(RegistryTypeReader& reader, const OString& sIndent)
fprintf(stdout, "%s access=optional\n", indent);
}
- fprintf(stdout, "%s Doku: \"%s\"\n", indent,
+ fprintf(stdout, "%s Doku: \"%s\"\n", indent,
OUStringToOString(reader.getReferenceDoku(i), RTL_TEXTENCODING_UTF8).getStr());
}
}
@@ -494,7 +494,7 @@ RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMo
{
errCode = rRegFile.create(regName, sAccessMode, REG_PAGESIZE);
}
-
+
if (errCode)
{
switch (errCode)
@@ -595,7 +595,7 @@ RegError ORegistry::destroyRegistry(const OUString& regName)
OUString systemName;
if ( FileBase::getSystemPathFromFileURL(m_name, systemName) != FileBase::E_None )
systemName = m_name;
-
+
OString name( OUStringToOString(systemName, osl_getThreadTextEncoding()) );
if (unlink(name.getStr()) != 0)
{
@@ -686,7 +686,7 @@ static OUString makePath( const OUString & resolvedPath, const OUString &path )
{
buf.appendAscii( "/" );
}
-
+
if( path[0] == '/' )
{
buf.append( path.getStr()+1 );
@@ -732,13 +732,13 @@ RegError ORegistry::openKeyWithoutLink(
sal_Int32 lastIndex = sFullKeyName.lastIndexOf('/');
sRelativKey = sFullKeyName.copy(lastIndex + 1);
sFullPath = sFullKeyName.copy(0, lastIndex + 1);
-
+
KeyMap::iterator ii = m_openKeyTable.find( sFullKeyName );
if( ii == m_openKeyTable.end() )
{
OStoreDirectory rStoreDir;
storeError _err = rStoreDir.create(pKey->getStoreFile(), sFullPath, sRelativKey, accessMode);
-
+
if (_err == store_E_NotExists)
return REG_KEY_NOT_EXISTS;
else
@@ -747,7 +747,7 @@ RegError ORegistry::openKeyWithoutLink(
if( _err != store_E_None )
return REG_KEY_NOT_EXISTS;
-
+
pRet = new ORegKey(sFullKeyName, rStoreDir, this);
*phOpenKey = pRet;
m_openKeyTable[sFullKeyName] = pRet;
@@ -2047,7 +2047,7 @@ RegError ORegistry::createLink(RegKeyHandle hKey,
sal_Int32 nIndex = 0;
OUString token;
-
+
do
{
token = sFullLinkName.getToken(0, '/', nIndex);
@@ -2152,12 +2152,12 @@ OUString ORegistry::resolveLinks(ORegKey* pKey, const OUString& path, sal_Bool f
resolvedPath += ROOT;
pLink = resolveLink(pKey, resolvedPath, token);
-
+
if (pLink)
{
OUString tmpName;
sal_Int32 lastIndex;
-
+
while(pLink)
{
if (!insertRecursionLink(pLink))
@@ -2166,15 +2166,15 @@ OUString ORegistry::resolveLinks(ORegKey* pKey, const OUString& path, sal_Bool f
delete pLink;
return OUString();
}
-
-
+
+
lastIndex = resolvedPath.lastIndexOf('/');
tmpName = resolvedPath.copy(lastIndex + 1);
resolvedPath = resolvedPath.copy(0, lastIndex + 1);
-
+
pLink = resolveLink(pKey, resolvedPath, tmpName);
}
-
+
resetRecursionLinks();
}
} while( nIndex != -1 );
@@ -2208,7 +2208,7 @@ ORegKey* ORegistry::resolveLink(ORegKey* pKey, OUString& resolvedPath, const OUS
} else
{
resolvedPath += name;
-
+
return NULL;
}
}
diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx
index 8798f0a61..fff3ed4ed 100644
--- a/registry/source/registry.cxx
+++ b/registry/source/registry.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: registry.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: hr $ $Date: 2002-08-15 16:26:00 $
+ * last change: $Author: hr $ $Date: 2003-03-26 15:37:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,13 +78,13 @@
#if defined(WIN32) || defined(WNT) || defined(__OS2__)
#include <io.h>
-#endif
+#endif
#include <string.h>
#if defined(UNX)
#include <stdlib.h>
#include <unistd.h>
-#endif
+#endif
using namespace salhelper;
@@ -107,33 +107,44 @@ OString getTempName()
if ( osl_getEnvironment(TMP.pData, &uTmpPattern.pData) != osl_Process_E_None )
{
- if ( osl_getEnvironment(TEMP.pData, &uTmpPattern.pData) != osl_Process_E_None )
+ if ( osl_getEnvironment(TEMP.pData, &uTmpPattern.pData) != osl_Process_E_None )
{
#if defined(SAL_W32) || defined(SAL_OS2)
- strcpy(tmpPattern, ".");
+ OSL_ASSERT( sizeof(tmpPattern) > RTL_CONSTASCII_LENGTH( "." ) );
+ strncpy(tmpPattern, ".", sizeof(tmpPattern)-1);
#else
- strcpy(tmpPattern, "/tmp");
-#endif
+ OSL_ASSERT( sizeof(tmpPattern) > RTL_CONSTASCII_LENGTH( "." ) );
+ strncpy(tmpPattern, ".", sizeof(tmpPattern)-1);
+#endif
}
}
if ( uTmpPattern.getLength() )
{
- strcpy(tmpPattern, OUStringToOString(uTmpPattern, RTL_TEXTENCODING_UTF8).getStr());
- }
+ OString aOStr( OUStringToOString(uTmpPattern, RTL_TEXTENCODING_UTF8) );
+ OSL_ASSERT( sizeof(tmpPattern) > aOStr.getLength() );
+ strncpy(tmpPattern, aOStr.getStr(), sizeof(tmpPattern)-1);
+ }
-#if defined(WIN32) || defined(WNT)
- strcat(tmpPattern, "\\reg_XXXXXX");
+#if defined(WIN32) || defined(WNT)
+ OSL_ASSERT( sizeof(tmpPattern) > ( strlen(tmpPattern)
+ + RTL_CONSTASCII_LENGTH("\\reg_XXXXXX") ) );
+ strncat(tmpPattern, "\\reg_XXXXXX", sizeof(tmpPattern)-1-strlen(tmpPattern));
pTmpName = mktemp(tmpPattern);
#endif
#ifdef __OS2__
- strcpy(tmpPattern, tempnam(NULL, "reg_"));
+ char* tmpname = tempnam(NULL, "reg_");
+ OSL_ASSERT( sizeof(tmpPattern) > strlen(tmpname) );
+ strncpy(tmpPattern, tmpname, sizeof(tmpPattern)-1);
pTmpName = tmpPattern;
#endif
#ifdef UNX
- strcat(tmpPattern, "/reg_XXXXXX");
+ OSL_ASSERT( sizeof(tmpPattern) > ( strlen(tmpPattern)
+ + RTL_CONSTASCII_LENGTH("/reg_XXXXXX") ) );
+ strncat(tmpPattern, "/reg_XXXXXX", sizeof(tmpPattern)-1-strlen(tmpPattern));
+
#if defined(FREEBSD) || defined(MACOSX)
pTmpName = mkstemp(tmpPattern);
#else
@@ -150,9 +161,9 @@ OString getTempName()
static void REGISTRY_CALLTYPE acquire(RegHandle hReg)
{
ORegistry* pReg = (ORegistry*) hReg;
-
+
if (pReg != NULL)
- pReg->acquire();
+ pReg->acquire();
}
@@ -180,7 +191,7 @@ static void REGISTRY_CALLTYPE release(RegHandle hReg)
static RegError REGISTRY_CALLTYPE getName(RegHandle hReg, rtl_uString** pName)
{
ORegistry* pReg;
-
+
if (hReg)
{
pReg = (ORegistry*)hReg;
@@ -190,12 +201,12 @@ static RegError REGISTRY_CALLTYPE getName(RegHandle hReg, rtl_uString** pName)
return REG_NO_ERROR;
} else
{
- rtl_uString_new(pName);
+ rtl_uString_new(pName);
return REG_REGISTRY_NOT_OPEN;
}
- }
+ }
- rtl_uString_new(pName);
+ rtl_uString_new(pName);
return REG_INVALID_REGISTRY;
}
diff --git a/registry/tools/checksingleton.cxx b/registry/tools/checksingleton.cxx
index 8103a3a36..aa3c62c96 100644
--- a/registry/tools/checksingleton.cxx
+++ b/registry/tools/checksingleton.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: checksingleton.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: hr $ $Date: 2002-02-21 11:03:37 $
+ * last change: $Author: hr $ $Date: 2003-03-26 15:37:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,7 +59,6 @@
*
************************************************************************/
#include <stdio.h>
-#include <string.h>
#include <set>
diff --git a/remotebridges/source/dynamicloader/dynamicloader.xml b/remotebridges/source/dynamicloader/dynamicloader.xml
index fd7a54175..018e0ff8a 100644
--- a/remotebridges/source/dynamicloader/dynamicloader.xml
+++ b/remotebridges/source/dynamicloader/dynamicloader.xml
@@ -12,7 +12,7 @@
</description>
<loader-name> com.sun.star.loader.SharedLibrary </loader-name>
<language> c++ </language>
- <status value="experimental"/>
+ <status value="final"/>
<supported-service> com.sun.star.loader.Dynamic </supported-service>
<service-dependency> com.sun.star.bridge.UnoUrlResolver </service-dependency>
<type> com.sun.star.bridge.XUnoUrlResolver </type>
diff --git a/remotebridges/source/unourl_resolver/makefile.mk b/remotebridges/source/unourl_resolver/makefile.mk
index 81041aee9..75f6368a2 100644
--- a/remotebridges/source/unourl_resolver/makefile.mk
+++ b/remotebridges/source/unourl_resolver/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.6 $
+# $Revision: 1.7 $
#
-# last change: $Author: jbu $ $Date: 2001-06-22 16:39:16 $
+# last change: $Author: hr $ $Date: 2003-03-26 15:41:33 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -102,9 +102,9 @@ SHL1TARGET= $(TARGET)
SHL1VERSIONMAP= $(TARGET).map
SHL1STDLIBS= \
+ $(SALLIB) \
$(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(SALLIB)
+ $(CPPUHELPERLIB)
SHL1DEPN=
SHL1IMPLIB= i$(TARGET)
diff --git a/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java b/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java
index 14b9f72a0..ba3de5663 100644
--- a/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java
+++ b/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java
@@ -2,9 +2,9 @@
*
* $RCSfile: TypeDescription.java,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: jbu $ $Date: 2001-10-26 11:43:05 $
+ * last change: $Author: hr $ $Date: 2003-03-26 15:44:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -63,6 +63,7 @@ package com.sun.star.lib.uno.typedesc;
import java.util.Enumeration;
+import java.util.HashMap;
import java.util.Hashtable;
import java.lang.reflect.Field;
@@ -97,7 +98,7 @@ import com.sun.star.lib.uno.typeinfo.TypeInfo;
* methods, which may be changed or moved in the furture, so please
* do not use these methods.
* <p>
- * @version $Revision: 1.13 $ $ $Date: 2001-10-26 11:43:05 $
+ * @version $Revision: 1.14 $ $ $Date: 2003-03-26 15:44:53 $
* @author Kay Ramme
* @since UDK2.0
*/
@@ -123,71 +124,75 @@ public class TypeDescription implements ITypeDescription {
public static final TypeDescription __type_TypeDescription = new TypeDescription(TypeClass.TYPE, "type", "[Lcom.sun.star.uno.Type;", Type.class); // TYPE
public static final TypeDescription __any_TypeDescription = new TypeDescription(TypeClass.ANY, "any", "[Ljava.lang.Object;", Object.class); // ANY
-
- static private final Hashtable __classToTypeDescription = new Hashtable();
- static private final Hashtable __typeNameToTypeDescription = new Hashtable();
- static private final Hashtable __typeClassToTypeName = new Hashtable();
-
- static private final Object[][] __typeClassToTypeDescription = new Object[][]{
- new Object[]{"java.lang.Void", "V", __void_TypeDescription}, // VOID
- new Object[]{"java.lang.Character", "C", __char_TypeDescription}, // CHAR
- new Object[]{"java.lang.Boolean", "Z", __boolean_TypeDescription}, // BOOLEAN
- new Object[]{"java.lang.Byte", "B", __byte_TypeDescription}, // BYTE
- new Object[]{"java.lang.Short", "S", __short_TypeDescription}, // SHORT
- new Object[]{"java.lang.Short", "S", __ushort_TypeDescription}, // UNSIGNED SHORT
- new Object[]{"java.lang.Integer", "I", __long_TypeDescription}, // LONG
- new Object[]{"java.lang.Integer", "I", __ulong_TypeDescription}, // UNSIGNED_LONG
- new Object[]{"java.lang.Long", "J", __hyper_TypeDescription}, // HYPER
- new Object[]{"java.lang.Long", "J", __uhyper_TypeDescription}, // UNSIGNED_HYPER
- new Object[]{"java.lang.Float", "F", __float_TypeDescription}, // FLOAT
- new Object[]{"java.lang.Double", "D", __double_TypeDescription}, // DOUBLE
- new Object[]{"java.lang.String", "Ljava.lang.String;", __string_TypeDescription}, // STRING
- new Object[]{"com.sun.star.uno.Type", "Lcom.sun.star.uno.Type;", __type_TypeDescription}, // TYPE
- new Object[]{"java.lang.Object", "Ljava.lang.Object;", __any_TypeDescription} // ANY
- };
-
+ static private final HashMap __typeNameToTypeDescription = new HashMap();
static {
- __typeNameToTypeDescription.put("boolean", __boolean_TypeDescription);
- __typeNameToTypeDescription.put("short", __short_TypeDescription);
- __typeNameToTypeDescription.put("unsigned short", __ushort_TypeDescription);
- __typeNameToTypeDescription.put("long", __long_TypeDescription);
- __typeNameToTypeDescription.put("unsigned long", __ulong_TypeDescription);
- __typeNameToTypeDescription.put("hyper", __hyper_TypeDescription);
- __typeNameToTypeDescription.put("unsigned hyper", __uhyper_TypeDescription);
- __typeNameToTypeDescription.put("float", __float_TypeDescription);
- __typeNameToTypeDescription.put("double", __double_TypeDescription);
- __typeNameToTypeDescription.put("char", __char_TypeDescription);
- __typeNameToTypeDescription.put("byte", __byte_TypeDescription);
- __typeNameToTypeDescription.put("string", __string_TypeDescription);
- __typeNameToTypeDescription.put("any", __any_TypeDescription);
- __typeNameToTypeDescription.put("void", __void_TypeDescription);
- __typeNameToTypeDescription.put("type", __type_TypeDescription);
-
- __classToTypeDescription.put(Void.class, __void_TypeDescription);
- __classToTypeDescription.put(void.class, __void_TypeDescription);
+ __typeNameToTypeDescription.put("void", __void_TypeDescription);
+ __typeNameToTypeDescription.put("boolean", __boolean_TypeDescription);
+ __typeNameToTypeDescription.put("char", __char_TypeDescription);
+ __typeNameToTypeDescription.put("byte", __byte_TypeDescription);
+ __typeNameToTypeDescription.put("short", __short_TypeDescription);
+ __typeNameToTypeDescription.put("unsigned short",
+ __ushort_TypeDescription);
+ __typeNameToTypeDescription.put("long", __long_TypeDescription);
+ __typeNameToTypeDescription.put("unsigned long",
+ __ulong_TypeDescription);
+ __typeNameToTypeDescription.put("hyper", __hyper_TypeDescription);
+ __typeNameToTypeDescription.put("unsigned hyper",
+ __uhyper_TypeDescription);
+ __typeNameToTypeDescription.put("float", __float_TypeDescription);
+ __typeNameToTypeDescription.put("double", __double_TypeDescription);
+ __typeNameToTypeDescription.put("string", __string_TypeDescription);
+ __typeNameToTypeDescription.put("type", __type_TypeDescription);
+ __typeNameToTypeDescription.put("any", __any_TypeDescription);
+ }
+
+ static private final HashMap __classToTypeDescription = new HashMap();
+ static {
+ __classToTypeDescription.put(void.class, __void_TypeDescription);
+ __classToTypeDescription.put(Void.class, __void_TypeDescription);
+ __classToTypeDescription.put(boolean.class, __boolean_TypeDescription);
+ __classToTypeDescription.put(Boolean.class, __boolean_TypeDescription);
+ __classToTypeDescription.put(char.class, __char_TypeDescription);
__classToTypeDescription.put(Character.class, __char_TypeDescription);
- __classToTypeDescription.put(char.class, __char_TypeDescription);
- __classToTypeDescription.put(Boolean.class, __boolean_TypeDescription);
- __classToTypeDescription.put(boolean.class, __boolean_TypeDescription);
- __classToTypeDescription.put(Byte.class, __byte_TypeDescription);
- __classToTypeDescription.put(byte.class, __byte_TypeDescription);
- __classToTypeDescription.put(Short.class, __short_TypeDescription);
- __classToTypeDescription.put(short.class, __short_TypeDescription);
- __classToTypeDescription.put(Integer.class, __long_TypeDescription);
- __classToTypeDescription.put(int.class, __long_TypeDescription);
- __classToTypeDescription.put(Long.class, __hyper_TypeDescription);
- __classToTypeDescription.put(long.class, __hyper_TypeDescription);
- __classToTypeDescription.put(Float.class, __float_TypeDescription);
- __classToTypeDescription.put(float.class, __float_TypeDescription);
- __classToTypeDescription.put(Double.class, __double_TypeDescription);
- __classToTypeDescription.put(double.class, __double_TypeDescription);
- __classToTypeDescription.put(String.class, __string_TypeDescription);
- __classToTypeDescription.put(Type.class, __type_TypeDescription);
- __classToTypeDescription.put(Any.class, __any_TypeDescription);
- __classToTypeDescription.put(Object.class, __any_TypeDescription);
- }
-
- static public boolean isTypeClassSimple(TypeClass typeClass) {
+ __classToTypeDescription.put(byte.class, __byte_TypeDescription);
+ __classToTypeDescription.put(Byte.class, __byte_TypeDescription);
+ __classToTypeDescription.put(short.class, __short_TypeDescription);
+ __classToTypeDescription.put(Short.class, __short_TypeDescription);
+ __classToTypeDescription.put(int.class, __long_TypeDescription);
+ __classToTypeDescription.put(Integer.class, __long_TypeDescription);
+ __classToTypeDescription.put(long.class, __hyper_TypeDescription);
+ __classToTypeDescription.put(Long.class, __hyper_TypeDescription);
+ __classToTypeDescription.put(float.class, __float_TypeDescription);
+ __classToTypeDescription.put(Float.class, __float_TypeDescription);
+ __classToTypeDescription.put(double.class, __double_TypeDescription);
+ __classToTypeDescription.put(Double.class, __double_TypeDescription);
+ __classToTypeDescription.put(String.class, __string_TypeDescription);
+ __classToTypeDescription.put(Type.class, __type_TypeDescription);
+ __classToTypeDescription.put(Object.class, __any_TypeDescription);
+ __classToTypeDescription.put(Any.class, __any_TypeDescription);
+ }
+
+ // must be sorted same as TypeClass:
+ private static final TypeDescription[] __typeClassToTypeDescription
+ = new TypeDescription[] {
+ __void_TypeDescription,
+ __char_TypeDescription,
+ __boolean_TypeDescription,
+ __byte_TypeDescription,
+ __short_TypeDescription,
+ __ushort_TypeDescription,
+ __long_TypeDescription,
+ __ulong_TypeDescription,
+ __hyper_TypeDescription,
+ __uhyper_TypeDescription,
+ __float_TypeDescription,
+ __double_TypeDescription,
+ __string_TypeDescription,
+ __type_TypeDescription,
+ __any_TypeDescription
+ };
+
+ public static boolean isTypeClassSimple(TypeClass typeClass) {
return typeClass.getValue() < __typeClassToTypeDescription.length;
}
@@ -424,6 +429,23 @@ public class TypeDescription implements ITypeDescription {
static private void addToCache(TypeDescription typeDescription) {
if(DEBUG_CACHE) System.err.println("addToCache:" + typeDescription.getTypeName());
+ // If typeDescription is a sequence type whose base component type is
+ // any of SHORT, UNSIGNED SHORT, LONG, UNSIGNED LONG, HYPER, UNSIGNED
+ // HYPER, ANY or com::sun::star::uno::XInterface, do not add it to the
+ // cache. Those UNO types have corresponding Java types that are not
+ // unique (e.g., both a sequence of SHORT and a sequence of UNSIGNED
+ // SHORT map to the Java type short[]), so using __typeCache_class to
+ // map from such a Java type to a type description could give a wrong
+ // result:
+ String n = typeDescription.getTypeName();
+ if (n.endsWith("[]short") || n.endsWith("[]unsigned short")
+ || n.endsWith("[]long") || n.endsWith("[]unsigned long")
+ || n.endsWith("[]hyper") || n.endsWith("[]unsigned hyper")
+ || n.endsWith("[]any")
+ || n.endsWith("[]com.sun.star.uno.XInterface")) {
+ return;
+ }
+
synchronized(__cacheEntrys) {
if(DEBUG_CACHE) listCache();
@@ -533,35 +555,30 @@ public class TypeDescription implements ITypeDescription {
return typeDescription;
}
- static public ITypeDescription getTypeDescription(Type type) throws ClassNotFoundException {
- ITypeDescription iTypeDescription = type.getTypeDescription();
-
- if(iTypeDescription == null) {
- if(type.getZClass() != null)
- iTypeDescription = getTypeDescription(type.getZClass());
-
- else if(type.getTypeClass() != null && type.getTypeClass() != TypeClass.UNKNOWN)
- iTypeDescription = getTypeDescription(type.getTypeClass());
-
- else if(type.getTypeName() != null)
- iTypeDescription = getTypeDescription(type.getTypeName());
-
- type.setTypeDescription(iTypeDescription);
+ public static ITypeDescription getTypeDescription(Type type)
+ throws ClassNotFoundException
+ {
+ ITypeDescription td = type.getTypeDescription();
+ if (td == null) {
+ if (type.getZClass() != null) {
+ td = getTypeDescription(type.getZClass());
+ } else {
+ td = getTypeDescription(type.getTypeClass());
+ if (td == null) {
+ td = getTypeDescription(type.getTypeName());
+ }
+ }
+ type.setTypeDescription(td);
}
-
- return iTypeDescription;
+ return td;
}
- static public TypeDescription getTypeDescription(TypeClass typeClass) {
- TypeDescription typeDescription = null;
-
- if(typeClass.getValue() < __typeClassToTypeDescription.length)
- typeDescription = (TypeDescription)__typeClassToTypeDescription[typeClass.getValue()][2];
-
- return typeDescription;
+ public static TypeDescription getTypeDescription(TypeClass typeClass) {
+ int n = typeClass.getValue();
+ return n < __typeClassToTypeDescription.length
+ ? __typeClassToTypeDescription[n] : null;
}
-
protected TypeClass _typeClass;
protected String _typeName;
protected String _arrayTypeName;
@@ -659,6 +676,8 @@ public class TypeDescription implements ITypeDescription {
_typeName = typeName;
_arrayTypeName = arrayTypeName;
_class = zClass;
+ // _componentType == null is ok, since only primitive TypeDescriptions
+ // are created with this constructor
}
private TypeDescription(Class zClass) {
@@ -887,19 +906,14 @@ public class TypeDescription implements ITypeDescription {
}
/**
- * Gets the component <code>TypeDescription</code> if
- * this is an array type.
- * <p>
- * @return the <code>TypeDescription</code>
+ * Gets the component <code>TypeDescription</code> if this is a sequence
+ * type.
+ *
+ * @return the component <code>TypeDescription</code>, or <code>null</code>
+ * if this is not a sequence type
*/
public ITypeDescription getComponentType() {
- ITypeDescription iTypeDescription = null;
-
- Class componentClass = getZClass().getComponentType();
- if(componentClass != null)
- iTypeDescription = getTypeDescription(componentClass);
-
- return iTypeDescription;
+ return _componentType;
}
/**
diff --git a/ridljar/com/sun/star/uno/Any.java b/ridljar/com/sun/star/uno/Any.java
index 5446b86ea..0dabf67c1 100644
--- a/ridljar/com/sun/star/uno/Any.java
+++ b/ridljar/com/sun/star/uno/Any.java
@@ -2,9 +2,9 @@
*
* $RCSfile: Any.java,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jbu $ $Date: 2002-01-18 14:04:55 $
+ * last change: $Author: hr $ $Date: 2003-03-26 15:44:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -72,7 +72,7 @@ package com.sun.star.uno;
* an explicit interface type, so the remote counterpart doesn't need to invoke
* a queryInterface).
* <p>
- * @version $Revision: 1.4 $ $ $Date: 2002-01-18 14:04:55 $
+ * @version $Revision: 1.5 $ $ $Date: 2003-03-26 15:44:54 $
* @since UDK1.0
*/
public class Any {
@@ -89,8 +89,12 @@ public class Any {
* @see #getObject
*/
protected Object _object;
-
-
+
+ public static final Any VOID = new Any(new Type("void", TypeClass.VOID),
+ null);
+ // do not use Type.VOID here to avoid circular dependencies between
+ // static members of Any and Type
+
/**
* Constructs a new any.
* <p>
@@ -129,6 +133,9 @@ public class Any {
public Object getObject() {
return _object;
}
-}
-
+ // @see java.lang.Object#toString
+ public String toString() {
+ return "Any[" + _type + ", " + _object + "]";
+ }
+}
diff --git a/ridljar/com/sun/star/uno/ITypeDescription.java b/ridljar/com/sun/star/uno/ITypeDescription.java
index 57a36054e..1df78df0a 100644
--- a/ridljar/com/sun/star/uno/ITypeDescription.java
+++ b/ridljar/com/sun/star/uno/ITypeDescription.java
@@ -2,9 +2,9 @@
*
* $RCSfile: ITypeDescription.java,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: kr $ $Date: 2001-05-08 09:34:18 $
+ * last change: $Author: hr $ $Date: 2003-03-26 15:44:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,7 +65,7 @@ package com.sun.star.uno;
* The <code>ITypeDescription</code> allows to examine a type
* in detail (e.g. it is used for marshaling/unmarshaling).
* <p>
- * @version $Revision: 1.1 $ $ $Date: 2001-05-08 09:34:18 $
+ * @version $Revision: 1.2 $ $ $Date: 2003-03-26 15:44:54 $
* @author Kay Ramme
* @since UDK3.0
*/
@@ -139,16 +139,77 @@ public interface ITypeDescription {
ITypeDescription getComponentType();
/**
- * Gets the type name.
- * <p>
- * @return the type name.
+ * Gets the (UNO) type name.
+ *
+ * <p>The following table lists how UNO types map to type names:</p>
+ * <table>
+ * <thead>
+ * <tr><th>UNO type</th><th>type name</th></tr>
+ * </thead>
+ * <tbody>
+ * <tr><td>VOID</td><td><code>"void"</code></td></tr>
+ * <tr><td>BOOLEAN</td><td><code>"boolean"</code></td></tr>
+ * <tr><td>CHAR</td><td><code>"char"</code></td></tr>
+ * <tr><td>BYTE</td><td><code>"byte"</code></td></tr>
+ * <tr><td>SHORT</td><td><code>"short"</code></td></tr>
+ * <tr>
+ * <td>UNSIGNED SHORT</td><td><code>"unsigned short"</code></td>
+ * </tr>
+ * <tr><td>LONG</td><td><code>"long"</code></td></tr>
+ * <tr><td>UNSIGNED LONG</td><td><code>"unsigned long"</code></td></tr>
+ * <tr><td>HYPER</td><td></td><code>"hyper"</code></tr>
+ * <tr>
+ * <td>UNSIGNED HYPER</td><td></td><code>"unsigned hyper"</code>
+ * </tr>
+ * <tr><td>FLOAT</td><td></td><code>"float"</code></tr>
+ * <tr><td>DOUBLE</td><td></td><code>"double"</code></tr>
+ * <tr><td>STRING</td><td></td><code>"string"</code></tr>
+ * <tr><td>TYPE</td><td></td><code>"type"</code></tr>
+ * <tr><td>ANY</td><td></td><code>"any"</code></tr>
+ * <tr>
+ * <td>sequence type of base type <var>T</var></td>
+ * <td><code>"[]"</code> followed by type name for <var>T</var></td>
+ * </tr>
+ * <tr>
+ * <td>enum type named <var>N</var></td>
+ * <td><var>N</var> (see below)</td>
+ * </tr>
+ * <tr>
+ * <td>struct type named <var>N</var></td>
+ * <td><var>N</var> (see below)</td>
+ * </tr>
+ * <tr>
+ * <td>exception type named <var>N</var>
+ * </td><td><var>N</var> (see below)</td>
+ * </tr>
+ * <tr>
+ * <td>interface type named <var>N</var></td>
+ * <td><var>N</var> (see below)</td>
+ * </tr>
+ * <tbody>
+ * </table>
+ * <p>For a UNO type named <var>N</var>, consisting of a sequence of module
+ * names <var>M<sub>1</sub></var>, ..., <var>M<sub>n</sub></var> followed by
+ * a simple name <var>S</var>, the corresponding type name consists of the
+ * same sequence of module names and simple name, with <code>"."</code>
+ * seperating the individual elements.</p>
+ *
+ * @return the type name.
*/
String getTypeName();
/**
- * Gets the array type name.
- * <p>
- * @return the array type name.
+ * Gets the (Java) array type name.
+ *
+ * <p>The array type name is defined to be the Java class name (as returned
+ * by <code>Class.forName</code>) of the Java array class that corresponds
+ * to the UNO sequence type with this type (the UNO type represented by this
+ * <code>ITypeDescription</code> instance) as base type. For an
+ * <code>ITypeDescription</code> instance representing the UNO type VOID,
+ * the array type name is defined to be
+ * <code>"[Ljava.lang.Void;"</code>.</p>
+ *
+ * @return the array type name.
*/
String getArrayTypeName();
diff --git a/ridljar/com/sun/star/uno/Type.java b/ridljar/com/sun/star/uno/Type.java
index f4038bbc6..9e368500d 100644
--- a/ridljar/com/sun/star/uno/Type.java
+++ b/ridljar/com/sun/star/uno/Type.java
@@ -2,9 +2,9 @@
*
* $RCSfile: Type.java,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: dbo $ $Date: 2002-10-30 11:10:41 $
+ * last change: $Author: hr $ $Date: 2003-03-26 15:44:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,28 +61,35 @@
package com.sun.star.uno;
-
-
-import java.util.Hashtable;
+import java.util.HashMap;
/**
- * The Type class represents the IDL builtin type <code>type</code>.
- * <p>
- * The IDL type is not directly mapped to <code>java.lang.Class</code>,
- * because it can be necessary to describe a type which is unknown
- * to the java runtime system, e.g. for delaying the need of a class,
- * so that it is possible to generate it on the fly.
- * <p>
- * @version $Revision: 1.8 $ $ $Date: 2002-10-30 11:10:41 $
- * @since UDK1.0
+ * Represents the UNO built-in type <code>TYPE</code>.
+ *
+ * <p>The UNO type is not directly mapped to <code>java.lang.Class</code> for at
+ * least two reasons. For one, some UNO types (like <code>UNSIGNED
+ * SHORT</code>) do not have a matching Java class. For another, it can be
+ * necessary to describe a type which is unknown to the Java runtime system
+ * (for example, for delaying the need of a class, so that it is possible to
+ * generate it on the fly.)</p>
+ *
+ * <p>A <code>Type</code> is uniquely determined by its type class (a
+ * <code>TypeClass</code>) and its type name (a <code>String</code>); these two
+ * will never be <code>null</code>. A <code>Type</code> may have an additional
+ * "z class" (a <code>java.lang.Class</code>), giving a Java class type that
+ * corresponds to the UNO type. Also, a <code>Type</code> can cache a type
+ * description (a <code>com.sun.star.uno.ITypeDescription</code>), which can be
+ * computed and set by <code>TypeDescription.getTypeDescription</code>.
+ *
+ * @since UDK1.0
*/
public class Type {
- /**
- * When set to true, enables various debugging output.
- */
- private static final boolean DEBUG = false;
+ // The following private static members and static initializer must come
+ // first in the class definition, so that the class can be initialized
+ // sucessfully:
- static private final String[] __typeClassToTypeName = new String[]{
+ // must be sorted same as TypeClass:
+ private static final String[] __typeClassToTypeName = new String[] {
"void",
"char",
"boolean",
@@ -92,81 +99,104 @@ public class Type {
"long",
"unsigned long",
"hyper",
- "unsigned hyper",
+ "unsigned hyper",
"float",
- "double",
+ "double",
"string",
"type",
"any"
};
- static private final Hashtable __javaClassToTypeName = new Hashtable();
+ private static final HashMap __javaClassToTypeName = new HashMap();
- static private final Hashtable __typeNameToTypeClass = new Hashtable();
+ private static final HashMap __typeNameToTypeClass = new HashMap();
static {
- for(int i = 0; i < __typeClassToTypeName.length; ++ i)
- __typeNameToTypeClass.put(__typeClassToTypeName[i], TypeClass.fromInt(i));
-
- __javaClassToTypeName.put(Void.class, "void");
- __javaClassToTypeName.put(void.class, "void");
+ for (int i = 0; i < __typeClassToTypeName.length; ++i) {
+ __typeNameToTypeClass.put(__typeClassToTypeName[i],
+ TypeClass.fromInt(i));
+ }
+ __javaClassToTypeName.put(Void.class, "void");
+ __javaClassToTypeName.put(void.class, "void");
__javaClassToTypeName.put(Character.class, "char");
__javaClassToTypeName.put(char.class, "char");
- __javaClassToTypeName.put(Boolean.class, "boolean");
- __javaClassToTypeName.put(boolean.class, "boolean");
- __javaClassToTypeName.put(Byte.class, "byte");
- __javaClassToTypeName.put(byte.class, "byte");
- __javaClassToTypeName.put(Short.class, "short");
- __javaClassToTypeName.put(short.class, "short");
- __javaClassToTypeName.put(Integer.class, "long");
- __javaClassToTypeName.put(int.class, "long");
- __javaClassToTypeName.put(Long.class, "hyper");
- __javaClassToTypeName.put(long.class, "hyper");
- __javaClassToTypeName.put(Float.class, "float");
- __javaClassToTypeName.put(float.class, "float");
- __javaClassToTypeName.put(Double.class, "double");
- __javaClassToTypeName.put(double.class, "double");
- __javaClassToTypeName.put(String.class, "string");
- __javaClassToTypeName.put(Type.class, "type");
- __javaClassToTypeName.put(Any.class, "any");
- __javaClassToTypeName.put(Object.class, "any");
- }
-
- static private boolean __isTypeClassPrimitive(TypeClass typeClass) {
- return typeClass.getValue() < 15;
+ __javaClassToTypeName.put(Boolean.class, "boolean");
+ __javaClassToTypeName.put(boolean.class, "boolean");
+ __javaClassToTypeName.put(Byte.class, "byte");
+ __javaClassToTypeName.put(byte.class, "byte");
+ __javaClassToTypeName.put(Short.class, "short");
+ __javaClassToTypeName.put(short.class, "short");
+ __javaClassToTypeName.put(Integer.class, "long");
+ __javaClassToTypeName.put(int.class, "long");
+ __javaClassToTypeName.put(Long.class, "hyper");
+ __javaClassToTypeName.put(long.class, "hyper");
+ __javaClassToTypeName.put(Float.class, "float");
+ __javaClassToTypeName.put(float.class, "float");
+ __javaClassToTypeName.put(Double.class, "double");
+ __javaClassToTypeName.put(double.class, "double");
+ __javaClassToTypeName.put(String.class, "string");
+ __javaClassToTypeName.put(Type.class, "type");
+ __javaClassToTypeName.put(Any.class, "any");
+ __javaClassToTypeName.put(Object.class, "any");
}
-
- protected String _typeName;
- protected Class _class;
- protected TypeClass _typeClass;
-
- protected ITypeDescription _iTypeDescription;
-
+ public static final Type VOID = new Type(void.class);
+ public static final Type CHAR = new Type(char.class);
+ public static final Type BOOLEAN = new Type(boolean.class);
+ public static final Type BYTE = new Type(byte.class);
+ public static final Type SHORT = new Type(short.class);
+ public static final Type UNSIGNED_SHORT = new Type(
+ "unsigned short", TypeClass.UNSIGNED_SHORT);
+ public static final Type LONG = new Type(int.class);
+ public static final Type UNSIGNED_LONG = new Type(
+ "unsigned long", TypeClass.UNSIGNED_LONG);
+ public static final Type HYPER = new Type(long.class);
+ public static final Type UNSIGNED_HYPER = new Type(
+ "unsigned hyper", TypeClass.UNSIGNED_HYPER);
+ public static final Type FLOAT = new Type(float.class);
+ public static final Type DOUBLE = new Type(double.class);
+ public static final Type STRING = new Type(String.class);
+ public static final Type TYPE = new Type(Type.class);
+ public static final Type ANY = new Type(Any.class);
/**
- * Constructs a new <code>Type</code> which defaults
- * to <code>void</code>
- * <p>
- * @since UDK3.0
+ * Constructs a new <code>Type</code> which defaults to <code>VOID</code>.
+ *
+ * @since UDK3.0
*/
public Type() {
this(void.class);
}
+ /**
+ * Constructs a new <code>Type</code> with the given type class and type
+ * name.
+ *
+ * @param typeName the type name. Must not be <code>null</code>.
+ * @param typeClass the type class. Must not be <code>null</code>, and must
+ * match the <code>typeName</code> (for example, it is illegal to
+ * combine a <code>typeName</code> of <code>"void"</code> with a
+ * <code>typeClass</code> of <code>BOOLEAN</code>).
+ */
+ public Type(String typeName, TypeClass typeClass) {
+ _typeClass = typeClass;
+ _typeName = typeName;
+ }
/**
- * Constructs a new <code>Type</code> with
- * the given <code>class</code>.
- * <p>
- * @since UDK3.0
- * @param zClass the java class of this type
+ * Constructs a new <code>Type</code> from the given
+ * <code>java.lang.Class</code>.
+ *
+ * @param zClass the Java class of this type. Must not be
+ * <code>null</code>.
+ *
+ * @since UDK3.0
*/
public Type(Class zClass) {
_class = zClass;
_typeName = (String)__javaClassToTypeName.get(zClass);
- if(_typeName != null)
+ if(_typeName != null)
_typeClass = (TypeClass)__typeNameToTypeClass.get(_typeName);
else {
@@ -202,27 +232,37 @@ public class Type {
}
/**
- * Constructs a new <code>Type</code> with
- * the given type description.
- * <p>
- * @since UDK3.0
- * @param typeDescription a type description
+ * Constructs a new <code>Type</code> from the given type description.
+ *
+ * @param typeDescription a type description. Must not be
+ * <code>null</code>.
+ *
+ * @since UDK3.0
*/
- public Type(ITypeDescription iTypeDescription) {
- _typeName = iTypeDescription.getTypeName();
- _typeClass = iTypeDescription.getTypeClass();
- _iTypeDescription = iTypeDescription;
+ public Type(ITypeDescription typeDescription) {
+ _typeName = typeDescription.getTypeName();
+ _typeClass = typeDescription.getTypeClass();
+ _iTypeDescription = typeDescription;
}
/**
- * Constructs a new <code>Type</code> with
- * the given type name.
- * <p>
- * @since UDK3.0
- * @param typeName the name of this type. For simple types
- * (numbers,string,type,any), the typeclass is calculated,
- * for complex types (structs,interfaces), the
- * typeclass of this object is set to UNKNOWN
+ * Constructs a new <code>Type</code> with the given type name.
+ *
+ * <p>TODO: This constructor is dangerous, as it can create a
+ * <code>Type</code> with an <code>UNKNOWN</code> type class. It would be
+ * better if this constructor threw a <code>IllegalArgumentException</code>
+ * instead.</p>
+ *
+ * @param typeName the name of this type; must not be <code>null</code>.
+ * For simple types (<code>VOID</code>, <code>BOOLEAN</code>,
+ * <code>CHAR</code>, <code>BYTE</code>, <code>SHORT</code>,
+ * <code>UNSIGNED SHORT</code>, <code>LONG</code>, <code>UNSIGNED
+ * LONG</code>, <code>HYPER</code>, <code>UNSIGNED HYPER</code>,
+ * <code>FLOAT</code>, <code>DOUBLE</code>, <code>STRING</code>,
+ * <code>TYPE</code>, <code>ANY</code>), the type class is calculated;
+ * for other types, the type class is set to <code>UNKNOWN</code>.
+ *
+ * @since UDK3.0
*/
public Type(String typeName) {
_typeClass = (TypeClass)__typeNameToTypeClass.get(typeName);
@@ -232,27 +272,21 @@ public class Type {
_typeName = typeName;
}
-
- public Type( String type_name, TypeClass type_class )
- {
- _typeClass = type_class;
- _typeName = type_name;
- }
-
/**
- * Constructs a new <code>Type</code> with
- * the given <code>TypeClass</code>.
- * <p>
- * @since UDK3.0
- * @param typeClass the <code>TypeClass</code> of this type. Only typeclass for
- * simple types is allowed.
- *
- * @throws IllegalArgumentException when the typeClass is not simple (e.g.
- a struct or an interface. The Constructor cannot find out the
- name of the type in this case.
+ * Constructs a new <code>Type</code> with the given type class.
+ *
+ * @param typeClass the type class of this type; must not be
+ * <code>null</code>. Only type classes for simple types are allowed
+ * here.
+ *
+ * @throws IllegalArgumentException if the given <code>typeClass</code> is
+ * not simple (for example, a struct or an interface type). This
+ * constructor could not find out the type name in such a case.
+ *
+ * @since UDK3.0
*/
- public Type(TypeClass typeClass) throws IllegalArgumentException {
+ public Type(TypeClass typeClass) {
if(__isTypeClassPrimitive(typeClass)) {
_typeClass = typeClass;
_typeName = __typeClassToTypeName[typeClass.getValue()];
@@ -262,93 +296,88 @@ public class Type {
}
/**
- * Gives the type description of this type.
- * <p>
- * @since UDK3.0
- * @return the type description
+ * Gets the type class.
+ *
+ * @return the type class. Will never be <code>null</code>, but might be
+ * <code>UNKNOWN</code>.
+ *
+ * @since UDK1.0
*/
- public ITypeDescription getTypeDescription() {
- return _iTypeDescription;
- }
-
- /**
- * Sets the type description for this type.
- * <p>
- * @since UDK3.0
- * @return the type description
- */
- public void setTypeDescription(ITypeDescription iTypeDescription) {
- _iTypeDescription = iTypeDescription;
+ public TypeClass getTypeClass() {
+ return _typeClass;
}
/**
* Gets the type name.
- * Returns <code>null</code> if this
- * type has not been constructed by name.
- * <p>
- * @since UDK1.0
- * @return the type name.
+ *
+ * @return the type name; will never be <code>null</code>
+ *
+ * @since UDK1.0
*/
- public String getTypeName() {
+ public String getTypeName() {
return _typeName;
}
-
+
/**
- * Gets the java class.
- * Returns <code>null</code> if this
- * type has not been constructed by <code>Class</code>.
- * <p>
- * @since UDK1.0
- * @return the type name. Maybe null.
+ * Gets the Java class.
+ *
+ * <p>Returns <code>null</code> if this type has not been constructed by
+ * <code>Class</code>.</p>
+ *
+ * @return the type name; may be <code>null</code>
+ *
+ * @since UDK1.0
*/
- public Class getZClass() {
+ public Class getZClass() {
return _class;
}
-
+
/**
- * Gets the typeClass.
- * Returns <code>null</code> if this
- * type has not been constructed by <code>TypeClass</code>.
- * <p>
- * @since UDK1.0
- * @return the type class. May be TypeClass.UNKNOWN.
+ * Gives the type description of this type.
+ *
+ * @return the type description; may be <code>null</code>
+ *
+ * @since UDK3.0
*/
- public TypeClass getTypeClass() {
- return _typeClass;
+ public ITypeDescription getTypeDescription() {
+ return _iTypeDescription;
}
-
+
/**
- * Compares two types.
- * <p>
- * @return true, if the given type and this type are equal
+ * Sets the type description for this type.
+ *
+ * @param typeDescription the type description
+ *
+ * @since UDK3.0
*/
- public boolean equals(Object object) {
- boolean result = false;
-
- Type type = (Type)object;
-
- if(type != null)
- result = _typeName.equals(type._typeName);
+ public void setTypeDescription(ITypeDescription typeDescription) {
+ _iTypeDescription = typeDescription;
+ }
- return result;
+ // @see java.lang.Object#equals
+ public boolean equals(Object obj) {
+ return this == obj
+ || (obj instanceof Type
+ && _typeName.equals(((Type) obj)._typeName));
}
- /**
- * Calculates the hash code.
- * <p>
- * @return the hash code
- */
+ // @see java.lang.Object#hashCode
public int hashCode() {
return _typeName.hashCode();
}
- /**
- * Constructs a descriptive <code>String</code> for the type.
- * <p>
- * @return a descriptive <code>String</code>
- */
+ // @see java.lang.Object#toString
public String toString() {
- return "Type<" + _typeName + ">";
+ return "Type[" + _typeName + "]";
+ }
+
+ private static boolean __isTypeClassPrimitive(TypeClass typeClass) {
+ return typeClass.getValue() < __typeClassToTypeName.length;
}
-}
+ protected TypeClass _typeClass; // TODO should be final
+ protected String _typeName; // TODO should be final
+ protected Class _class; // TODO should be final
+
+ protected ITypeDescription _iTypeDescription;
+}
diff --git a/ridljar/prj/build.lst b/ridljar/prj/build.lst
index 478cb2cff..058fd7015 100644
--- a/ridljar/prj/build.lst
+++ b/ridljar/prj/build.lst
@@ -4,11 +4,11 @@ ri ridljar nmake - all ri_genall NULL
ri ridljar\com\sun\star\lib\uno\typedesc nmake - all ri_typedesc ri_typeinfo ri_uno NULL
ri ridljar\com\sun\star\lib\uno\typeinfo nmake - all ri_typeinfo ri_genall NULL
ri ridljar\com\sun\star\uno nmake - all ri_uno ri_typeinfo NULL
-ri ridljar\com\sun\star\util nmake - all ri_package_util ri_typeinfo ri_uno ri_lang NULL
+ri ridljar\com\sun\star\util nmake - all ri_package_util ri_typeinfo ri_uno ri_container NULL
ri ridljar\com\sun\star\util\logging nmake - all ri_log ri_typeinfo ri_beans NULL
ri ridljar\com\sun\star\lang nmake - all ri_lang ri_uno NULL
ri ridljar\com\sun\star\security nmake - all ri_sec ri_uno NULL
-ri ridljar\com\sun\star\reflection nmake - all ri_reflection ri_lang NULL
+ri ridljar\com\sun\star\reflection nmake - all ri_reflection ri_lang ri_container NULL
ri ridljar\com\sun\star\beans nmake - all ri_beans ri_container ri_reflection NULL
ri ridljar\com\sun\star\bridge nmake - all ri_bridge ri_connection ri_container NULL
ri ridljar\com\sun\star\connection nmake - all ri_connection ri_io NULL
diff --git a/ridljar/prj/d.lst b/ridljar/prj/d.lst
index c5443f0fb..8f23c5c5c 100644
--- a/ridljar/prj/d.lst
+++ b/ridljar/prj/d.lst
@@ -1,5 +1,7 @@
..\%__SRC%\class\ridl.jar %_DEST%\bin%_EXT%\ridl.jar
+..\%__SRC%\bin\ridl*_src.zip %COMMON_DEST%\bin%_EXT%\ridl*_src.zip
+
..\%__SRC%\lib\lib*static*.dylib %_DEST%\lib%_EXT%\lib*static*.dylib
..\%__SRC%\misc\*staticdatamembers.cxx %_DEST%\inc%_EXT%\*staticdatamembers.cxx
..\%__SRC%\misc\*staticdatamembers.h* %_DEST%\inc%_EXT%\*staticdatamembers.h*
diff --git a/ridljar/util/delzip b/ridljar/util/delzip
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ridljar/util/delzip
diff --git a/ridljar/util/makefile.mk b/ridljar/util/makefile.mk
index 39f3243b7..91ea5e7ac 100644
--- a/ridljar/util/makefile.mk
+++ b/ridljar/util/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.2 $
+# $Revision: 1.3 $
#
-# last change: $Author: jl $ $Date: 2002-10-25 06:52:55 $
+# last change: $Author: hr $ $Date: 2003-03-26 15:44:58 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -76,6 +76,19 @@ JARCLASSDIRS = com
JARTARGET = $(TARGET).jar
JARCOMPRESS = TRUE
+# Special work necessary for building java reference with javadoc.
+# The source of puplic APIs must be delivered and used later in the
+# odk module.
+ZIP1TARGET=$(TARGET)_src
+ZIP1FLAGS=-u -r
+ZIP1DIR=$(PRJ)
+ZIP1LIST=com -x "*makefile.mk"
+
+ZIP2TARGET=$(TARGET)2_src
+ZIP2FLAGS=-u -r
+ZIP2DIR=$(MISC)$/java
+ZIP2LIST=com
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk