summaryrefslogtreecommitdiff
path: root/cpp/src/slice2java/Gen.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2007-06-19 11:25:17 -0700
committerMark Spruiell <mes@zeroc.com>2007-06-19 11:25:17 -0700
commitddcfe70b4f05fb00e466486fc19076147f79298d (patch)
treeacfa4428263b22b3f9226d04a3fe8f910bd21bdd /cpp/src/slice2java/Gen.cpp
parentFor UDP multicast bind to the multicast address rather than 0.0.0.0 unless on... (diff)
downloadice-ddcfe70b4f05fb00e466486fc19076147f79298d.tar.bz2
ice-ddcfe70b4f05fb00e466486fc19076147f79298d.tar.xz
ice-ddcfe70b4f05fb00e466486fc19076147f79298d.zip
bug 2245 - adding support for protected class data members
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r--cpp/src/slice2java/Gen.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index fb07de4ca1c..1309eb43c52 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -2596,7 +2596,20 @@ Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p)
out << nl << " * @deprecated " << deprecateReason;
out << nl << " **/";
}
- out << nl << "public " << s << ' ' << name << ';';
+
+ //
+ // Access visibility for class data members can be controlled by metadata.
+ // If none is specified, the default is public.
+ //
+ if(contained->containedType() == Contained::ContainedTypeClass &&
+ (p->hasMetaData("protected") || contained->hasMetaData("protected")))
+ {
+ out << nl << "protected " << s << ' ' << name << ';';
+ }
+ else
+ {
+ out << nl << "public " << s << ' ' << name << ';';
+ }
//
// Getter/Setter.