本文整理汇总了C++中UmlPackage::javaPackage方法的典型用法代码示例。如果您正苦于以下问题:C++ UmlPackage::javaPackage方法的具体用法?C++ UmlPackage::javaPackage怎么用?C++ UmlPackage::javaPackage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UmlPackage
的用法示例。
在下文中一共展示了UmlPackage::javaPackage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: import
void UmlClass::import(QTextOStream & f, const QCString & indent) {
QCString s;
if (!isJavaExternal()) {
UmlArtifact * cp = associatedArtifact();
UmlPackage * pack = (UmlPackage *)
((cp != 0) ? (UmlItem *) cp : (UmlItem *) this)->package();
if ((s = pack->javaPackage()).isEmpty())
return;
QCString s2 = name();
UmlItem * p = this;
while ((p = p->parent())->kind() == aClass)
s2 = p->name() + dot + s2;
s += dot + s2;
}
else if ((s = package()->javaPackage()).isEmpty())
return;
else
s += dot + name();
if (! UmlArtifact::generated_one()->is_imported(s)) {
f << indent << "import " << s << ";\n";
UmlArtifact::generated_one()->imported(s);
}
}
示例2: write
void UmlClass::write(QTextOStream & f) {
if (isJavaExternal()) {
QCString s = javaDecl().stripWhiteSpace();
int index;
if ((index = s.find("${name}")) != -1)
s.replace(index, 7, name());
else if ((index = s.find("${Name}")) != -1)
s.replace(index, 7, capitalize(name()));
else if ((index = s.find("${NAME}")) != -1)
s.replace(index, 7, name().upper());
else if ((index = s.find("${nAME}")) != -1)
s.replace(index, 7, name().lower());
f << s;
}
else {
UmlClass * toplevel = this;
UmlItem * p;
QCString s2;
while ((p = toplevel->parent())->kind() == aClass) {
toplevel = (UmlClass *) p;
s2 = dot + p->name() + s2;
}
UmlArtifact * cp = toplevel->associatedArtifact();
UmlPackage * pack = (UmlPackage *)
((cp != 0) ? (UmlItem *) cp : (UmlItem *) toplevel)->package();
if (pack != UmlArtifact::generation_package()) {
QCString s = pack->javaPackage();
if (! s.isEmpty() && (s != "java.lang") && (s.left(10) != "java.lang.")) {
s += s2;
if (JavaSettings::isForcePackagePrefixGeneration() ||
!UmlArtifact::generated_one()->is_imported(s, name()))
f << s << '.';
}
}
else if (! s2.isEmpty())
f << s2.mid(1) << '.';
f << name();
}
}