|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgr.spinellis.umlgraph.doclet.ClassGraph
class ClassGraph
Class graph generation engine
Nested Class Summary | |
---|---|
(package private) static class |
ClassGraph.Align
|
private static class |
ClassGraph.FieldRelationInfo
|
(package private) static class |
ClassGraph.Font
|
Field Summary | |
---|---|
static Map<RelationType,String> |
associationMap
|
protected Map<String,ClassInfo> |
classnames
|
protected ClassDoc |
collectionClassDoc
|
protected Doc |
contextDoc
|
protected static char |
FILE_SEPARATOR
|
protected String |
linePostfix
|
protected String |
linePrefix
|
protected ClassDoc |
mapClassDoc
|
protected OptionProvider |
optionProvider
|
protected Set<String> |
rootClasses
|
protected PrintWriter |
w
|
Constructor Summary | |
---|---|
ClassGraph(RootDoc root,
OptionProvider optionProvider,
Doc contextDoc)
Create a new ClassGraph. |
Method Summary | ||
---|---|---|
private void |
attributes(Options opt,
FieldDoc[] fd)
Print the class's attributes fd |
|
protected static String |
buildRelativePath(String contextPackageName,
String classPackageName)
|
|
String |
classToUrl(ClassDoc cd,
boolean rootClass)
Convert the class name into a corresponding URL |
|
String |
classToUrl(String className)
Convert the class name into a corresponding URL |
|
void |
epilogue()
Dot epilogue |
|
private String |
escape(String s)
Escape <, >, and & characters in the string with the corresponding HTML entity code. |
|
private void |
externalTableEnd()
|
|
private void |
externalTableStart(Options opt,
String name,
String url)
|
|
private
|
filterByVisibility(T[] docs,
Visibility visibility)
Returns all program element docs that have a visibility greater or equal than the specified level |
|
private String |
fontWrap(String text,
Options opt,
ClassGraph.Font font)
Wraps the text with the appropriate font according to the specified font type |
|
private String |
fontWrap(String text,
String fontName,
double fontSize)
Wraps the text with the appropriate font tags when the font name and size are not void |
|
protected ClassInfo |
getClassInfo(String className)
|
|
private ClassGraph.FieldRelationInfo |
getFieldRelationInfo(FieldDoc field)
|
|
private Type[] |
getInterfaceTypeArguments(ClassDoc iface,
Type t)
|
|
private String |
getNodeName(ClassDoc c)
|
|
private String |
getNodeName(String c)
Return a class's internal name |
|
private String |
guillemize(Options opt,
String s)
Convert < and > characters in the string to the respective guillemot characters. |
|
private String |
guilWrap(Options opt,
String str)
Wraps a string in Guillemot (or an ASCII substitute) characters. |
|
private boolean |
hidden(ProgramElementDoc c)
Return true if c has a @hidden tag associated with it |
|
private boolean |
hidden(String s)
Return true if the class name is associated to an hidden class or matches a hide expression |
|
private void |
innerTableEnd()
|
|
private void |
innerTableStart()
|
|
private String |
mapApiDocRoot(String className)
Returns the appropriate URL "root" for a given class name. |
|
private ClassInfo |
newClassInfo(String className,
boolean printed,
boolean hidden)
|
|
private void |
nodeProperties(Options opt)
Print the common class node's properties |
|
private boolean |
operations(Options opt,
ConstructorDoc[] m)
Print the class's constructors m |
|
private boolean |
operations(Options opt,
MethodDoc[] m)
Print the class's operations m |
|
private String |
parameter(Options opt,
Parameter[] p)
Print the method parameter p |
|
String |
printClass(ClassDoc c,
boolean rootClass)
Prints the class if needed. |
|
void |
printExtraClasses(RootDoc root)
Print classes that were parts of relationships, but not parsed by javadoc |
|
void |
printInferredDependencies(ClassDoc c)
Prints dependencies recovered from the methods of a class. |
|
void |
printInferredDependencies(ClassDoc[] classes)
Prints dependencies recovered from the methods of a class. |
|
void |
printInferredRelations(ClassDoc c)
Prints associations recovered from the fields of a class. |
|
void |
printInferredRelations(ClassDoc[] classes)
Prints associations recovered from the fields of a class. |
|
void |
printRelations(ClassDoc c)
Print a class's relations |
|
void |
prologue()
Dot prologue |
|
private String |
qualifiedName(Options opt,
String r)
Return the class's name, possibly by stripping the leading path |
|
private void |
relation(Options opt,
RelationType rt,
ClassDoc from,
String fromName)
Print all relations for a given's class's tag |
|
private void |
relation(Options opt,
RelationType rt,
String from,
String fromName,
String dest,
String destName,
String tailLabel,
String label,
String headLabel)
|
|
private String |
removeTemplate(String name)
Removes the template specs from a class name. |
|
private void |
stereotype(Options opt,
Doc c,
ClassGraph.Align align)
Return as a string the stereotypes associated with c terminated by the escape character term |
|
private void |
tableLine(ClassGraph.Align align,
String text)
|
|
private void |
tableLine(ClassGraph.Align align,
String text,
Options opt,
ClassGraph.Font font)
|
|
private void |
tagvalue(Options opt,
Doc c)
Return as a string the tagged values associated with c |
|
private String |
type(Options opt,
Type t)
Print a a basic type t |
|
private String |
typeAnnotation(Options opt,
Type t)
Annotate an field/argument with its type t |
|
private String |
typeParameters(Options opt,
ParameterizedType t)
Print the parameters of the parameterized type t |
|
private String |
visibility(Options opt,
ProgramElementDoc e)
Print the visibility adornment of element e prefixed by any stereotypes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final char FILE_SEPARATOR
public static Map<RelationType,String> associationMap
protected Map<String,ClassInfo> classnames
protected Set<String> rootClasses
protected OptionProvider optionProvider
protected PrintWriter w
protected ClassDoc collectionClassDoc
protected ClassDoc mapClassDoc
protected String linePostfix
protected String linePrefix
protected Doc contextDoc
Constructor Detail |
---|
public ClassGraph(RootDoc root, OptionProvider optionProvider, Doc contextDoc)
The packages passed as an argument are the ones specified on the command line.
Local URLs will be generated for these packages.
root
- The root of docs as provided by the javadoc APIoptionProvider
- The main option providercontextDoc
- The current context for generating relative links, may be a ClassDoc
or a PackageDoc (used by UMLDoc)Method Detail |
---|
private String qualifiedName(Options opt, String r)
private String escape(String s)
private String guillemize(Options opt, String s)
private String guilWrap(Options opt, String str)
str
- the String
to be wrapped.
String
.private String visibility(Options opt, ProgramElementDoc e)
private String parameter(Options opt, Parameter[] p)
private String type(Options opt, Type t)
private String typeParameters(Options opt, ParameterizedType t)
private String typeAnnotation(Options opt, Type t)
private void attributes(Options opt, FieldDoc[] fd)
private boolean operations(Options opt, ConstructorDoc[] m)
private boolean operations(Options opt, MethodDoc[] m)
private void nodeProperties(Options opt)
private void tagvalue(Options opt, Doc c)
opt
- the Options used to guess font namesc
- the Doc entry to look for @tagvalueprevterm
- the termination string for the previous elementterm
- the termination character for each tagged valueprivate void stereotype(Options opt, Doc c, ClassGraph.Align align)
private boolean hidden(ProgramElementDoc c)
protected ClassInfo getClassInfo(String className)
private ClassInfo newClassInfo(String className, boolean printed, boolean hidden)
private boolean hidden(String s)
public String printClass(ClassDoc c, boolean rootClass)
A class is a rootClass if it's included among the classes returned by RootDoc.classes(), this information is used to properly compute relative links in diagrams for UMLDoc
private String getNodeName(ClassDoc c)
private String getNodeName(String c)
private void relation(Options opt, RelationType rt, ClassDoc from, String fromName)
tagname
- the tag containing the given relationfrom
- the source classfromName
- the source class internal nameedgetype
- the dot edge specificationprivate void relation(Options opt, RelationType rt, String from, String fromName, String dest, String destName, String tailLabel, String label, String headLabel)
public void printRelations(ClassDoc c)
public void printExtraClasses(RootDoc root)
public void printInferredRelations(ClassDoc[] classes)
classes
- public void printInferredRelations(ClassDoc c)
classes
- public void printInferredDependencies(ClassDoc[] classes)
classes
- public void printInferredDependencies(ClassDoc c)
classes
- private <T extends ProgramElementDoc> List<T> filterByVisibility(T[] docs, Visibility visibility)
private ClassGraph.FieldRelationInfo getFieldRelationInfo(FieldDoc field)
private Type[] getInterfaceTypeArguments(ClassDoc iface, Type t)
private String removeTemplate(String name)
public String classToUrl(ClassDoc cd, boolean rootClass)
protected static String buildRelativePath(String contextPackageName, String classPackageName)
public String classToUrl(String className)
private String mapApiDocRoot(String className)
public void prologue() throws IOException
IOException
public void epilogue()
private void externalTableStart(Options opt, String name, String url)
private void externalTableEnd()
private void innerTableStart()
private void innerTableEnd()
private void tableLine(ClassGraph.Align align, String text)
private void tableLine(ClassGraph.Align align, String text, Options opt, ClassGraph.Font font)
private String fontWrap(String text, Options opt, ClassGraph.Font font)
opt
- text
- font
-
private String fontWrap(String text, String fontName, double fontSize)
text
- the text to be wrappedfontName
- considered void when it's nullfontSize
- considered void when it's <= 0
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |