How to generate a class diagram of Apex class or trigger in salesforce in easy way. If Any tool is available please suggest me.
I have used above for unmanaged package code and that generates class diagram.
Long before the Force.com Tooling API came out I tried to buid a native tool in Salesforce to render UML class diagrams for Apex classes and SObjects.
The extraction of the class and object information is solely done in Apex. I really had to use ugly RegExp parsing of classes to get out relationships, fields and object.
This definitly runs into limits or errors if you classes are too complex. So regard this as a proof of concept and...
Feel free to check it out. It can be easily installed (but also forked and improved) on GitHub: https://github.com/rsoesemann/plantuml4force