diff options
author | Mark Spruiell <mes@zeroc.com> | 2005-02-09 18:55:46 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2005-02-09 18:55:46 +0000 |
commit | 8e755f59261fc66631a8ed7a319961e5afc31d15 (patch) | |
tree | bf7a9225b4e8c8ca6ce4aa70d6e31689c72d3630 /cpp/src/Slice/JavaUtil.cpp | |
parent | update copyright date (diff) | |
download | ice-8e755f59261fc66631a8ed7a319961e5afc31d15.tar.bz2 ice-8e755f59261fc66631a8ed7a319961e5afc31d15.tar.xz ice-8e755f59261fc66631a8ed7a319961e5afc31d15.zip |
allow metadata for dictionary types
Diffstat (limited to 'cpp/src/Slice/JavaUtil.cpp')
-rw-r--r-- | cpp/src/Slice/JavaUtil.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp index 5cd86656d14..5a270b708c8 100644 --- a/cpp/src/Slice/JavaUtil.cpp +++ b/cpp/src/Slice/JavaUtil.cpp @@ -455,13 +455,26 @@ Slice::JavaGenerator::typeToString(const TypePtr& type, DictionaryPtr dict = DictionaryPtr::dynamicCast(type); if(dict) { + string dictType = findMetaData(metaData); if(mode == TypeModeOut) { return getAbsolute(dict, package, "", "Holder"); } else { - return "java.util.Map"; + if(dictType.empty()) + { + StringList l = dict->getMetaData(); + dictType = findMetaData(l); + } + if(!dictType.empty()) + { + return dictType; + } + else + { + return "java.util.Map"; + } } } @@ -2452,9 +2465,9 @@ Slice::JavaGenerator::MetaDataVisitor::validate(const SyntaxTreeBasePtr& p, cons const string& file, const string& line) { // - // Currently only sequence types can be affected by metadata. + // Currently only sequence and dictionary types can be affected by metadata. // - if(!metaData.empty() && !SequencePtr::dynamicCast(p)) + if(!metaData.empty() && !SequencePtr::dynamicCast(p) && !DictionaryPtr::dynamicCast(p)) { string str; ContainedPtr cont = ContainedPtr::dynamicCast(p); |