86793

Doxygen dot. Draw link between classes by annotation

Doxygen can generate class diagrams with graphiz.

For example:

class A {...}; class B extends A {...};

From this code I can generate a picture where doxygen can show that one class it the parent of an other.

But is there a way to generate a picture from code with manual references between classes?

For example when I describe DB scheme and use contract classes (http://developer.android.com/training/basics/data-storage/databases.html#DefineContract) I want to perform smth like this:

class MainClass { class A { String COLUMN_ID = "id_a"; } /** * {@dotlinkto MainClass.A} **/ @OrAnotationToDrawLink(A.class) class B { String COLUMN_ID = "id_b"; String COLUMN_FOREIGN_KEY_TO_A = "id_a_key"; } }

And generate a picture of 2 classes A and B with reference between them.

I've tried to search through documentation but can't find any suitable examples or explanation about custom drawing in javadoc+doxygen+graphviz.

Answer1:

The closest thing I can think of is to define a custom command that expands to an inline dot graph, i.e.

class MainClass { public class A { String COLUMN_ID = "id_a"; } /** * @dotlinkbetween{A,B} * @cond **/ @OrAnotationToDrawLink(A.class) /** @endcond */ public class B { String COLUMN_ID = "id_b"; String COLUMN_FOREIGN_KEY_TO_A = "id_a_key"; } }

with the following ALIAS definition in doxygen's configuration file:

ALIASES = dotlinkbetween{2}="@dot digraph { node [shape=record ]; \1 [ URL=\"\ref \1\" ]; \2 [ URL=\"\ref \2\" ]; \2 -> \1; } @enddot"

note that I had to use @cond ... @endcond to let doxygen skip the @OrAnotationToDrawLink line.

Recommend

  • Checking validation results in Keras shows only 50% correct. Clearly random
  • Loss in Tensorflow suddenly turn into nan
  • Tagging columns as Categorical in Spark
  • How can I detect a hardware-button-press from within an Android Wear watch face?
  • How to create a regex that will match regardless of the sequence of characters?
  • I want to use WebBrowser Control in Mono Windows Form
  • Difference between forecast and predict function in R
  • Tensorflow neural network prediction is always the same
  • Can I pass the objective and derivative functions to scipy.optimize.minimize as one function?
  • OpenCV 2.2 and multi-CPUs - Is opencv_haartraining.exe multithreaded?
  • What is the learning curve for development on JD Edwards?
  • Different outcomes when using tf.Variable() and tf.get_variable()
  • Multi-dimensional regression with Keras
  • MVC 3 - Editor template for List Model [closed]
  • updating and compacting sqlite database in android
  • Is it good to have multiple database running in a same project?
  • Sinatra server won't start - “wrong number of arguments”
  • How to get or calculate size of Azure File/Share or Service
  • JSF Cannot format given Object as a Date
  • parameterized queries in oursql
  • Where to save the local DB created for iphone app?
  • get passwords from chrome
  • MySQL: Difference between `… ADD INDEX(a); … ADD INDEX(b);` and `… ADD INDEX(a,b);`?
  • Does the Azure table storage API cache results?
  • Xcode 4 NSLog Macro link in Xcode 3
  • Disable Enter in editText android
  • Cannot resolve symbol 'MyApi'
  • Asynchronous UI Testing in Xcode With Swift
  • If I include Java 8 in my Android app does that affect which devices it will work on?
  • Why is an OPTIONS request sent to the server?
  • Release, debug version and Authorization Google?
  • How to get icons for entities from eclipse?
  • Proper way to use connect-multiparty with express.js?
  • Load html files in TinyMce
  • embed rChart in Markdown
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • JaxB to read class hierarchy
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • How can I use `wmic` in a Windows PE script?
  • Unable to use reactive element in my shiny app