• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • codeimport
javaimport.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2006-2013 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 // own header
12 #include "javaimport.h"
13 
14 // app includes
15 #include "attribute.h"
16 #include "classifier.h"
17 #include "codeimpthread.h"
18 #include "debug_utils.h"
19 #include "enum.h"
20 #include "import_utils.h"
21 #include "operation.h"
22 #include "package.h"
23 #include "uml.h"
24 #include "umldoc.h"
25 #include "umlpackagelist.h"
26 
27 // qt includes
28 #include <QFile>
29 #include <QRegExp>
30 #include <QStringList>
31 #include <QTextStream>
32 
33 QStringList JavaImport::s_filesAlreadyParsed;
34 int JavaImport::s_parseDepth = 0;
35 
39 JavaImport::JavaImport(CodeImpThread* thread)
40  : NativeImportBase("//", thread)
41 {
42  setMultiLineComment("/*", "*/");
43  initVars();
44 }
45 
49 JavaImport::~JavaImport()
50 {
51 }
52 
56 void JavaImport::initVars()
57 {
58  m_isStatic = false;
59 }
60 
67 QString JavaImport::joinTypename(const QString& typeName)
68 {
69  QString typeNameRet(typeName);
70  if (m_srcIndex + 1 < m_source.size()) {
71  if (m_source[m_srcIndex + 1] == "<" ||
72  m_source[m_srcIndex + 1] == "[") {
73  int start = ++m_srcIndex;
74  if (! skipToClosing(m_source[start][0]))
75  return typeNameRet;
76  for (int i = start; i <= m_srcIndex; ++i) {
77  typeNameRet += m_source[i];
78  }
79  }
80  }
81  // to handle multidimensional arrays, call recursively
82  if ((m_srcIndex + 1 < m_source.size()) && (m_source[m_srcIndex + 1] == "[")) {
83  typeNameRet = joinTypename(typeNameRet);
84  }
85  return typeNameRet;
86 }
87 
92 void JavaImport::fillSource(const QString& word)
93 {
94  QString lexeme;
95  const uint len = word.length();
96  for (uint i = 0; i < len; ++i) {
97  const QChar& c = word[i];
98  if (c.isLetterOrNumber() || c == '_' || c == '.') {
99  lexeme += c;
100  } else {
101  if (!lexeme.isEmpty()) {
102  m_source.append(lexeme);
103  lexeme.clear();
104  }
105  m_source.append(QString(c));
106  }
107  }
108  if (!lexeme.isEmpty())
109  m_source.append(lexeme);
110 }
111 
116 void JavaImport::spawnImport(const QString& file)
117 {
118  // if the file is being parsed, don't bother
119  //
120  if (s_filesAlreadyParsed.contains(file)) {
121  return;
122  }
123  if (QFile::exists(file)) {
124  JavaImport importer;
125  QStringList fileList;
126  fileList.append(file);
127  s_filesAlreadyParsed.append(file);
128  importer.importFiles(fileList);
129  }
130 }
131 
138 UMLObject* JavaImport::findObject(const QString& name, UMLPackage *parentPkg)
139 {
140  UMLDoc *umldoc = UMLApp::app()->document();
141  UMLObject * o = umldoc->findUMLObject(name, UMLObject::ot_UMLObject, parentPkg);
142  return o;
143 }
144 
149 UMLObject* JavaImport::resolveClass (const QString& className)
150 {
151  uDebug() << "importJava trying to resolve " << className;
152  // keep track if we are dealing with an array
153  //
154  bool isArray = className.contains('[');
155  // remove any [] so that the class itself can be resolved
156  //
157  QString baseClassName = className;
158  baseClassName.remove('[');
159  baseClassName.remove(']');
160 
161  // java has a few implicit imports. Most relevant for this is the
162  // current package, which is in the same directory as the current file
163  // being parsed
164  //
165  QStringList file = m_currentFileName.split('/');
166  // remove the filename. This leaves the full path to the containing
167  // dir which should also include the package hierarchy
168  //
169  file.pop_back();
170 
171  // the file we're looking for might be in the same directory as the
172  // current class
173  //
174  QString myDir = file.join("/");
175  QString myFile = myDir + '/' + baseClassName + ".java";
176  if (QFile::exists(myFile)) {
177  spawnImport(myFile);
178  if (isArray) {
179  // we have imported the type. For arrays we want to return
180  // the array type
181  return Import_Utils::createUMLObject(UMLObject::ot_Class, className, m_scope[m_scopeIndex]);
182  }
183  return findObject(baseClassName, m_scope[m_scopeIndex]);
184  }
185 
186  // the class we want is not in the same package as the one being imported.
187  // use the imports to find the one we want.
188  //
189  QStringList package = m_currentPackage.split('.');
190  int dirsInPackageCount = package.size();
191 
192  // in case the path does not fit into the package hierachy
193  // we cannot check the imports
194  if (dirsInPackageCount >= file.size())
195  return NULL;
196 
197  for (int count=0; count < dirsInPackageCount; ++count) {
198  // pop off one by one the directories, until only the source root remains
199  //
200  file.pop_back();
201  }
202  // this is now the root of any further source imports
203  QString sourceRoot = file.join("/") + '/';
204 
205  for (QStringList::Iterator pathIt = m_imports.begin();
206  pathIt != m_imports.end(); ++pathIt) {
207  QString import = (*pathIt);
208  QStringList split = import.split('.');
209  split.pop_back(); // remove the * or the classname
210  if (import.endsWith('*') || import.endsWith(baseClassName)) {
211  // check if the file we want is in this imported package
212  // convert the org.test type package into a filename
213  //
214  QString aFile = sourceRoot + split.join("/") + '/' + baseClassName + ".java";
215  if (QFile::exists(aFile)) {
216  spawnImport(aFile);
217  // we need to set the package for the class that will be resolved
218  // start at the root package
219  UMLPackage *parent = m_scope[0];
220  UMLPackage *current = NULL;
221 
222  for (QStringList::Iterator it = split.begin(); it != split.end(); ++it) {
223  QString name = (*it);
224  UMLObject *ns = Import_Utils::createUMLObject(UMLObject::ot_Package,
225  name, parent);
226  current = static_cast<UMLPackage*>(ns);
227  parent = current;
228  } // for
229  if (isArray) {
230  // we have imported the type. For arrays we want to return
231  // the array type
232  return Import_Utils::createUMLObject(UMLObject::ot_Class, className, current);
233  }
234  // now that we have the right package, the class should be findable
235  return findObject(baseClassName, current);
236  } // if file exists
237  } // if import matches
238  } //foreach import
239  return NULL; // no match
240 }
241 
246 bool JavaImport::parseFile(const QString& filename)
247 {
248  m_currentFileName = filename;
249  m_imports.clear();
250  // default visibility is Impl, unless we are an interface, then it is
251  // public for member vars and methods
252  m_defaultCurrentAccess = Uml::Visibility::Implementation;
253  m_currentAccess = m_defaultCurrentAccess;
254  s_parseDepth++;
255  // in the case of self referencing types, we can avoid parsing the
256  // file twice by adding it to the list
257  s_filesAlreadyParsed.append(filename);
258  NativeImportBase::parseFile(filename);
259  s_parseDepth--;
260  if (s_parseDepth <= 0) {
261  // if the user decides to clear things out and reparse, we need
262  // to honor the request, so reset things for next time.
263  s_filesAlreadyParsed.clear();
264  s_parseDepth = 0;
265  }
266  return true;
267 }
268 
273 bool JavaImport::parseStmt()
274 {
275  const int srcLength = m_source.count();
276  QString keyword = m_source[m_srcIndex];
277  //uDebug() << '"' << keyword << '"';
278  if (keyword == "package") {
279  m_currentPackage = advance();
280  const QString& qualifiedName = m_currentPackage;
281  const QStringList names = qualifiedName.split('.');
282  for (QStringList::ConstIterator it = names.begin(); it != names.end(); ++it) {
283  QString name = (*it);
284  log(keyword + ' ' + name);
285  UMLObject *ns = Import_Utils::createUMLObject(UMLObject::ot_Package,
286  name, m_scope[m_scopeIndex], m_comment);
287  m_scope[++m_scopeIndex] = static_cast<UMLPackage*>(ns);
288  }
289  if (advance() != ";") {
290  uError() << "importJava: unexpected: " << m_source[m_srcIndex];
291  skipStmt();
292  }
293  return true;
294  }
295  if (keyword == "class" || keyword == "interface") {
296  const QString& name = advance();
297  const UMLObject::ObjectType t = (keyword == "class" ? UMLObject::ot_Class : UMLObject::ot_Interface);
298  log(keyword + ' ' + name);
299  UMLObject *ns = Import_Utils::createUMLObject(t, name, m_scope[m_scopeIndex], m_comment);
300  m_scope[++m_scopeIndex] = m_klass = static_cast<UMLClassifier*>(ns);
301  m_klass->setAbstract(m_isAbstract);
302  m_klass->setStatic(m_isStatic);
303  m_klass->setVisibility(m_currentAccess);
304  // The UMLObject found by createUMLObject might originally have been created as a
305  // placeholder with a type of class but if is really an interface, then we need to
306  // change it.
307  UMLObject::ObjectType ot = (keyword == "interface" ? UMLObject::ot_Interface : UMLObject::ot_Class);
308  m_klass->setBaseType(ot);
309  m_isAbstract = m_isStatic = false;
310  // if no modifier is specified in an interface, then it means public
311  if (m_klass->isInterface()) {
312  m_defaultCurrentAccess = Uml::Visibility::Public;
313  }
314  if (advance() == ";") // forward declaration
315  return true;
316  if (m_source[m_srcIndex] == "<") {
317  // template args - preliminary, rudimentary implementation
318  // @todo implement all template arg syntax
319  uint start = m_srcIndex;
320  if (! skipToClosing('<')) {
321  uError() << "importJava(" << name << "): template syntax error";
322  return false;
323  }
324  while (1) {
325  const QString arg = m_source[++start];
326  if (! arg.contains(QRegExp("^[A-Za-z_]"))) {
327  uDebug() << "importJava(" << name << "): cannot handle template syntax ("
328  << arg << ")";
329  break;
330  }
331  /* UMLTemplate *tmpl = */ m_klass->addTemplate(arg);
332  const QString next = m_source[++start];
333  if (next == ">")
334  break;
335  if (next != ",") {
336  uDebug() << "importJava(" << name << "): cannot handle template syntax ("
337  << next << ")";
338  break;
339  }
340  }
341  advance(); // skip over ">"
342  }
343  if (m_source[m_srcIndex] == "extends") {
344  const QString& baseName = advance();
345  // try to resolve the class we are extending, or if impossible
346  // create a placeholder
347  UMLObject *parent = resolveClass(baseName);
348  if (parent) {
349  Import_Utils::createGeneralization(m_klass, static_cast<UMLClassifier*>(parent));
350  } else {
351  uDebug() << "importJava parentClass " << baseName
352  << " is not resolveable. Creating placeholder";
353  Import_Utils::createGeneralization(m_klass, baseName);
354  }
355  advance();
356  }
357  if (m_source[m_srcIndex] == "implements") {
358  while (m_srcIndex < srcLength - 1 && advance() != "{") {
359  const QString& baseName = m_source[m_srcIndex];
360  // try to resolve the interface we are implementing, if this fails
361  // create a placeholder
362  UMLObject *interface = resolveClass(baseName);
363  if (interface) {
364  Import_Utils::createGeneralization(m_klass, static_cast<UMLClassifier*>(interface));
365  } else {
366  uDebug() << "importJava implementing interface "<< baseName
367  <<" is not resolvable. Creating placeholder";
368  Import_Utils::createGeneralization(m_klass, baseName);
369  }
370  if (advance() != ",")
371  break;
372  }
373  }
374  if (m_source[m_srcIndex] != "{") {
375  uError() << "importJava: ignoring excess chars at " << name
376  << " (" << m_source[m_srcIndex] << ")";
377  skipStmt("{");
378  }
379  return true;
380  }
381  if (keyword == "enum") {
382  const QString& name = advance();
383  log(keyword + ' ' + name);
384  UMLObject *ns = Import_Utils::createUMLObject(UMLObject::ot_Enum,
385  name, m_scope[m_scopeIndex], m_comment);
386  UMLEnum *enumType = static_cast<UMLEnum*>(ns);
387  skipStmt("{");
388  while (m_srcIndex < srcLength - 1 && advance() != "}") {
389  Import_Utils::addEnumLiteral(enumType, m_source[m_srcIndex]);
390  QString next = advance();
391  if (next == "{" || next == "(") {
392  if (! skipToClosing(next[0]))
393  return false;
394  next = advance();
395  }
396  if (next != ",") {
397  if (next == ";") {
398  // @todo handle methods in enum
399  // For now, we cheat (skip them)
400  m_source[m_srcIndex] = '{';
401  if (! skipToClosing('{'))
402  return false;
403  }
404  break;
405  }
406  }
407  return true;
408  }
409  if (keyword == "static") {
410  m_isStatic = true;
411  return true;
412  }
413  // if we detected static previously and keyword is { then this is a static block
414  if (m_isStatic && keyword == "{") {
415  // reset static flag and jump to end of static block
416  m_isStatic = false;
417  return skipToClosing('{');
418  }
419  if (keyword == "abstract") {
420  m_isAbstract = true;
421  return true;
422  }
423  if (keyword == "public") {
424  m_currentAccess = Uml::Visibility::Public;
425  return true;
426  }
427  if (keyword == "protected") {
428  m_currentAccess = Uml::Visibility::Protected;
429  return true;
430  }
431  if (keyword == "private") {
432  m_currentAccess = Uml::Visibility::Private;
433  return true;
434  }
435  if (keyword == "final" ||
436  keyword == "native" ||
437  keyword == "synchronized" ||
438  keyword == "transient" ||
439  keyword == "volatile") {
440  //@todo anything to do here?
441  return true;
442  }
443  if (keyword == "import") {
444  // keep track of imports so we can resolve classes we are dependent on
445  QString import = advance();
446  if (import.endsWith('.')) {
447  //this most likely an import that ends with a *
448  //
449  import = import + advance();
450  }
451  m_imports.append(import);
452 
453  // move past ;
454  skipStmt();
455  return true;
456  }
457  if (keyword == "@") { // annotation
458  advance();
459  if (m_source[m_srcIndex + 1] == "(") {
460  advance();
461  skipToClosing('(');
462  }
463  return true;
464  }
465  if (keyword == "}") {
466  if (m_scopeIndex)
467  m_klass = dynamic_cast<UMLClassifier*>(m_scope[--m_scopeIndex]);
468  else
469  uError() << "importJava: too many }";
470  return true;
471  }
472  if (keyword == "<") { // @todo generic parameters
473  if (! skipToClosing('<')) {
474  uError() << "importJava(" << keyword << "): template syntax error";
475  return false;
476  }
477  advance();
478  if (m_srcIndex == srcLength)
479  return false;
480  keyword = m_source[m_srcIndex];
481  }
482  // At this point, we expect `keyword' to be a type name
483  // (of a member of class or interface, or return type
484  // of an operation.) Up next is the name of the attribute
485  // or operation.
486  if (! keyword.contains(QRegExp("^\\w"))) {
487  if (m_klass) {
488  uError() << "importJava: ignoring " << keyword <<
489  " at " << m_srcIndex << ", " << m_source.count() << " in " << m_klass->name();
490  } else {
491  uError() << "importJava: ignoring " << keyword <<
492  " at " << m_srcIndex << ", " << m_source.count() << " (outside class)";
493  }
494  return false;
495  }
496  QString typeName = m_source[m_srcIndex];
497  typeName = joinTypename(typeName);
498  // At this point we need a class.
499  if (m_klass == NULL) {
500  uError() << "importJava: no class set for " << typeName;
501  return false;
502  }
503  QString name = advance();
504  QString nextToken;
505  if (typeName == m_klass->name() && name == "(") {
506  // Constructor.
507  nextToken = name;
508  name = typeName;
509  typeName.clear();
510  } else {
511  nextToken = advance();
512  }
513  if (name.contains(QRegExp("\\W"))) {
514  uError() << "importJava: expecting name in " << name;
515  return false;
516  }
517  if (nextToken == "(") {
518  // operation
519  UMLOperation *op = Import_Utils::makeOperation(m_klass, name);
520  m_srcIndex++;
521  while (m_srcIndex < srcLength && m_source[m_srcIndex] != ")") {
522  QString typeName = m_source[m_srcIndex];
523  if (typeName == "final" || typeName.startsWith("//")) {
524  // ignore the "final" keyword and any comments in method args
525  typeName = advance();
526  }
527  typeName = joinTypename(typeName);
528  QString parName = advance();
529  // the Class might not be resolved yet so resolve it if necessary
530  UMLObject *obj = resolveClass(typeName);
531  if (obj) {
532  // by prepending the package, unwanted placeholder types will not get created
533  typeName = obj->fullyQualifiedName(".");
534  }
535  /* UMLAttribute *att = */ Import_Utils::addMethodParameter(op, typeName, parName);
536  if (advance() != ",")
537  break;
538  m_srcIndex++;
539  }
540  // before adding the method, try resolving the return type
541  UMLObject *obj = resolveClass(typeName);
542  if (obj) {
543  // using the fully qualified name means that a placeholder type will not be created.
544  typeName = obj->fullyQualifiedName(".");
545  }
546  Import_Utils::insertMethod(m_klass, op, m_currentAccess, typeName,
547  m_isStatic, m_isAbstract, false /*isFriend*/,
548  false /*isConstructor*/, m_comment);
549  m_isAbstract = m_isStatic = false;
550  // reset the default visibility
551  m_currentAccess = m_defaultCurrentAccess;
552  // At this point we do not know whether the method has a body or not.
553  do {
554  nextToken = advance();
555  } while (nextToken != "{" && nextToken != ";");
556  if (nextToken == ";") {
557  // No body (interface or abstract)
558  return true;
559  } else {
560  return skipToClosing('{');
561  }
562  }
563  // At this point we know it's some kind of attribute declaration.
564  while (1) {
565  while (nextToken != "," && nextToken != ";") {
566  if (nextToken == "=") {
567  if ((nextToken = advance()) == "new") {
568  advance();
569  if ((nextToken = advance()) == "(") {
570  skipToClosing('(');
571  if ((nextToken = advance()) == "{") {
572  skipToClosing('{');
573  } else {
574  skipStmt();
575  break;
576  }
577  } else {
578  skipStmt();
579  break;
580  }
581  } else {
582  skipStmt();
583  break;
584  }
585  } else {
586  name += nextToken; // add possible array dimensions to `name'
587  }
588  nextToken = advance();
589  if (nextToken.isEmpty()) {
590  break;
591  }
592  }
593  // try to resolve the class type, or create a placeholder if that fails
594  UMLObject *type = resolveClass(typeName);
595  if (type) {
596  Import_Utils::insertAttribute(
597  m_klass, m_currentAccess, name,
598  static_cast<UMLClassifier*>(type), m_comment, m_isStatic);
599  } else {
600  Import_Utils::insertAttribute(
601  m_klass, m_currentAccess, name,
602  typeName, m_comment, m_isStatic);
603  }
604  // UMLAttribute *attr = static_cast<UMLAttribute*>(o);
605  if (nextToken != ",") {
606  // reset the modifiers
607  m_isStatic = m_isAbstract = false;
608  break;
609  }
610  name = advance();
611  nextToken = advance();
612  }
613  // reset visibility to default
614  m_currentAccess = m_defaultCurrentAccess;
615  if (m_srcIndex < m_source.count()) {
616  if (m_source[m_srcIndex] != ";") {
617  uError() << "importJava: ignoring trailing items at " << name;
618  skipStmt();
619  }
620  }
621  else {
622  uError() << "index out of range: ignoring statement " << name;
623  skipStmt();
624  }
625  return true;
626 }
JavaImport::joinTypename
QString joinTypename(const QString &typeName)
Figure out if the type is really an array or template of the given typeName.
Definition: javaimport.cpp:67
UMLClassifier::addTemplate
UMLTemplate * addTemplate(const QString &name, Uml::ID::Type id=Uml::ID::None)
Adds an already created template.
Definition: classifier.cpp:1043
NativeImportBase::skipStmt
void skipStmt(const QString &until=";")
Advance m_srcIndex until m_source[m_srcIndex] contains the lexeme given by `until'.
Definition: nativeimportbase.cpp:81
NativeImportBase::setMultiLineComment
void setMultiLineComment(const QString &intro, const QString &end)
Set the delimiter strings for a multi line comment.
Definition: nativeimportbase.cpp:58
UMLPackage
This class contains the non-graphical information required for a UML Package.
Definition: package.h:32
NativeImportBase::m_klass
UMLClassifier * m_klass
class currently being processed
Definition: nativeimportbase.h:93
UMLClassifier
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
codeimpthread.h
NativeImportBase::split
virtual QStringList split(const QString &line)
Split the line so that a string is returned as a single element of the list.
Definition: nativeimportbase.cpp:260
javaimport.h
Import_Utils::insertAttribute
UMLObject * insertAttribute(UMLClassifier *owner, Uml::Visibility::Enum scope, const QString &name, UMLClassifier *attrType, const QString &comment, bool isStatic)
Create a UMLAttribute and insert it into the document.
Definition: import_utils.cpp:364
NativeImportBase::m_isAbstract
bool m_isAbstract
accumulator for abstractness
Definition: nativeimportbase.h:102
UMLObject::ot_Enum
Definition: umlobject.h:55
NativeImportBase
Intermediate base class for native Umbrello implementations of programming language import...
Definition: nativeimportbase.h:44
JavaImport::JavaImport
JavaImport(CodeImpThread *thread=0)
Constructor.
Definition: javaimport.cpp:39
JavaImport::m_defaultCurrentAccess
Uml::Visibility::Enum m_defaultCurrentAccess
current visibility for when the visibility is absent
Definition: javaimport.h:49
UMLObject::setVisibility
void setVisibility(Uml::Visibility::Enum visibility)
Sets the visibility of the object.
Definition: umlobject.cpp:445
ClassImport::log
void log(const QString &file, const QString &text)
Write info to a logger or to the debug output.
Definition: classimport.cpp:94
UMLApp::app
static UMLApp * app()
Get the last created instance of this class.
Definition: uml.cpp:206
NativeImportBase::m_currentAccess
Uml::Visibility::Enum m_currentAccess
current access (public/protected/private)
Definition: nativeimportbase.h:94
UMLClassifier::setBaseType
void setBaseType(UMLObject::ObjectType ot)
Reimplementation of method from class UMLObject for controlling the exact type of this classifier: cl...
Definition: classifier.cpp:82
JavaImport::m_currentPackage
QString m_currentPackage
current package of the file being parsed
Definition: javaimport.h:47
umlpackagelist.h
NativeImportBase::m_srcIndex
int m_srcIndex
used for indexing m_source
Definition: nativeimportbase.h:90
JavaImport::~JavaImport
virtual ~JavaImport()
Destructor.
Definition: javaimport.cpp:49
classifier.h
UMLApp::document
UMLDoc * document() const
Returns a pointer to the current document connected to the KMainWindow instance.
Definition: uml.cpp:872
debug_utils.h
Uml::Visibility::Private
Definition: basictypes.h:58
UMLObject
This class is the non-graphical version of UMLWidget.
Definition: umlobject.h:41
NativeImportBase::m_scope
QList< UMLPackage * > m_scope
stack of scopes for use by the specific importer
Definition: nativeimportbase.h:91
JavaImport::m_currentFileName
QString m_currentFileName
current filename being parsed
Definition: javaimport.h:46
NativeImportBase::m_source
QStringList m_source
the scanned lexemes
Definition: nativeimportbase.h:89
NativeImportBase::skipToClosing
bool skipToClosing(QChar opener)
Advance m_srcIndex to the index of the corresponding closing character of the given opening...
Definition: nativeimportbase.cpp:96
UMLClassifier::isInterface
bool isInterface() const
Returns true if this classifier represents an interface.
Definition: classifier.cpp:112
JavaImport::s_filesAlreadyParsed
static QStringList s_filesAlreadyParsed
Keep track of the files we have already parsed so we don't reparse the same ones over and over again...
Definition: javaimport.h:55
JavaImport::s_parseDepth
static int s_parseDepth
Keep track of the parses so that the filesAlreadyParsed can be reset when we're done.
Definition: javaimport.h:61
attribute.h
enum.h
Import_Utils::createUMLObject
UMLObject * createUMLObject(UMLObject::ObjectType type, const QString &inName, UMLPackage *parentPkg, const QString &comment, const QString &stereotype)
Find or create a document object.
Definition: import_utils.cpp:169
NativeImportBase::advance
QString advance()
Advance m_srcIndex until m_source[m_srcIndex] contains a non-comment.
Definition: nativeimportbase.cpp:143
Uml::Visibility::Implementation
Definition: basictypes.h:60
JavaImport::spawnImport
void spawnImport(const QString &file)
Spawn off an import of the specified file.
Definition: javaimport.cpp:116
NativeImportBase::m_comment
QString m_comment
intermediate accumulator for comment text
Definition: nativeimportbase.h:95
Import_Utils::insertMethod
void insertMethod(UMLClassifier *klass, UMLOperation *&op, Uml::Visibility::Enum scope, const QString &type, bool isStatic, bool isAbstract, bool isFriend, bool isConstructor, const QString &comment)
Insert the UMLOperation into the given classifier.
Definition: import_utils.cpp:435
Import_Utils::addMethodParameter
UMLAttribute * addMethodParameter(UMLOperation *method, const QString &type, const QString &name)
Add an argument to a UMLOperation.
Definition: import_utils.cpp:507
uDebug
#define uDebug()
Definition: debug_utils.h:95
NativeImportBase::m_scopeIndex
uint m_scopeIndex
indexes m_scope, index 0 is reserved for global scope
Definition: nativeimportbase.h:92
JavaImport::parseStmt
bool parseStmt()
Implement abstract operation from NativeImportBase.
Definition: javaimport.cpp:273
CodeImpThread
Thread class that does the code import work for one file.
Definition: codeimpthread.h:35
Uml::Visibility::Public
Definition: basictypes.h:57
UMLEnum
This class contains the non-graphical information required for a UML Enum.
Definition: enum.h:28
UMLObject::ot_Interface
Definition: umlobject.h:53
operation.h
umldoc.h
Import_Utils::makeOperation
UMLOperation * makeOperation(UMLClassifier *parent, const QString &name)
Create a UMLOperation.
Definition: import_utils.cpp:354
UMLOperation
This class represents an operation in the UML model.
Definition: operation.h:24
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:47
JavaImport::resolveClass
UMLObject * resolveClass(const QString &className)
Try to resolve the specified class the current class depends on.
Definition: javaimport.cpp:149
UMLObject::ot_Class
Definition: umlobject.h:56
package.h
JavaImport::m_imports
QStringList m_imports
imports included in the current file
Definition: javaimport.h:48
ClassImport::importFiles
bool importFiles(const QStringList &fileNames)
Import files.
Definition: classimport.cpp:62
import_utils.h
UMLObject::ot_UMLObject
Definition: umlobject.h:49
JavaImport::parseFile
bool parseFile(const QString &filename)
Keep track of the current file being parsed and reset the list of imports.
Definition: javaimport.cpp:246
uError
#define uError()
Definition: debug_utils.h:96
JavaImport::initVars
void initVars()
Reimplement operation from NativeImportBase.
Definition: javaimport.cpp:56
UMLObject::name
QString name() const
Returns a copy of m_name.
Definition: umlobject.cpp:185
JavaImport::m_isStatic
bool m_isStatic
static flag for the member var or method
Definition: javaimport.h:45
JavaImport::fillSource
void fillSource(const QString &word)
Implement abstract operation from NativeImportBase.
Definition: javaimport.cpp:92
UMLObject::ot_Package
Definition: umlobject.h:52
UMLObject::setAbstract
void setAbstract(bool bAbstract)
Sets the paste state of the object.
Definition: umlobject.cpp:320
Import_Utils::addEnumLiteral
void addEnumLiteral(UMLEnum *enumType, const QString &literal, const QString &comment)
Add an enum literal to an UMLEnum.
Definition: import_utils.cpp:528
UMLObject::setStatic
void setStatic(bool bStatic)
Sets the value for m_bStatic.
Definition: umlobject.cpp:343
UMLObject::fullyQualifiedName
virtual QString fullyQualifiedName(const QString &separator=QString(), bool includeRoot=false) const
Returns the fully qualified name, i.e.
Definition: umlobject.cpp:201
Import_Utils::createGeneralization
void createGeneralization(UMLClassifier *child, UMLClassifier *parent)
Create a generalization from the given child classifier to the given parent classifier.
Definition: import_utils.cpp:538
UMLDoc::findUMLObject
UMLObject * findUMLObject(const QString &name, UMLObject::ObjectType type=UMLObject::ot_UMLObject, UMLObject *currentObj=0)
Used to find a UMLObject by its type and name.
Definition: umldoc.cpp:809
Uml::Visibility::Protected
Definition: basictypes.h:59
JavaImport
Java code import.
Definition: javaimport.h:24
keyword
static const struct HashTable keyword
Definition: keywords.lut.h:123
NativeImportBase::parseFile
virtual bool parseFile(const QString &filename)
Import a single file.
Definition: nativeimportbase.cpp:353
uml.h
UMLDoc
UMLDoc provides a document object for a document-view model.
Definition: umldoc.h:63
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal