xjavadoc
Class XJavaDoc

java.lang.Object
  extended byxjavadoc.XJavaDoc

public final class XJavaDoc
extends java.lang.Object

This class represents the entry-point for xjavadoc classes. Come here to get classes and packages.

Author:
Aslak Hellesøy

Nested Class Summary
static class XJavaDoc.NoInnerClassesPredicate
           
 
Field Summary
static java.lang.String IS_UNICODE
          Indicates whether this XJavaDoc was built with or without unicode support
static int NO_IMPORTED_PACKAGES
          messgage level for reporting unqualified classes when there are no imported packages
static int ONE_OR_MORE_IMPORTED_PACKAGES
          messgage level for reporting unqualified classes when there are one or more imported packages
 
Constructor Summary
XJavaDoc()
           
 
Method Summary
 void addAbstractFile(java.lang.String qualifiedName, AbstractFile file)
           
 void addSourceSet(SourceSet sourceSet)
          Adds a new set of java sources to be parsed.
 java.lang.String dereferenceProperties(java.lang.String value)
           
 java.lang.String getDocEncoding()
          Getter for generated file charset.
 java.lang.String getEncoding()
          Getter for source file charset.
 java.util.Map getPropertyMap()
           
 java.util.Collection getSourceClasses()
          Returns all classes in the registered source sets, including inner classes
 java.util.Collection getSourceClasses(boolean useNodeParser)
          Deprecated. Call setUseNodeParser() prior to parsing and call the no-arg getSourceClasses()
 java.util.Collection getSourceClasses(boolean useNodeParser, boolean inner)
          Deprecated. Call setUseNodeParser() prior to parsing and call the no-arg getSourceClasses() or getSourceClasses(Predicate) with a Predicate that doesn't accept inner classes.
 java.util.Collection getSourceClasses(Predicate predicate)
           
 XPackage getSourcePackage(java.lang.String packageName)
          Returns the package.
 java.util.Collection getSourcePackages()
          Returns the packages of the specified classes during parsing.
 XTagFactory getTagFactory()
           
 XClass getXClass(java.lang.String qualifiedName)
          Get the XClass corresponding to the qualifiedName.
static void parsePropertyString(java.lang.String value, java.util.List fragments, java.util.List propertyRefs)
          Parses a string containing ${xxx} style property references into two lists.
 void printLogMessages(java.io.PrintStream out, int level)
          Prints the log messages encountered during parsing
static void printMemoryStatus()
          Dump to sytem out the status of XJavadoc.
 void registerTags(java.lang.String classpath)
          Registers tags.
static java.lang.String replaceProperties(java.lang.String value, java.util.Map keys)
          Replaces ${xxx} style constructions in the given value with the string value of the corresponding data types.
 void reset()
          Deprecated. use reset(boolean).
 void reset(boolean resetTimeStamp)
          Resets the caches.
 void setDocEncoding(java.lang.String docencoding)
          Setter for generated file charset.
 void setEncoding(java.lang.String encoding)
          Setter for source file charset.
 void setPropertyMap(java.util.Map properties)
           
 void setUseNodeParser(boolean useNodeParser)
          This method can be called prior to parsing so that all classes are parsed with AST (to make it possible to write the source back to disk)
 XClass updateClassTag(java.lang.String className, java.lang.String tagName, java.lang.String parameterName, java.lang.String parameterValue, int tagIndex)
          Describe what the method does
 XClass updateMethodTag(java.lang.String className, java.lang.String methodNameWithSignature, java.lang.String tagName, java.lang.String parameterName, java.lang.String parameterValue, int tagIndex)
          Describe what the method does
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IS_UNICODE

public static final java.lang.String IS_UNICODE
Indicates whether this XJavaDoc was built with or without unicode support

See Also:
Constant Field Values

NO_IMPORTED_PACKAGES

public static final int NO_IMPORTED_PACKAGES
messgage level for reporting unqualified classes when there are no imported packages

See Also:
Constant Field Values

ONE_OR_MORE_IMPORTED_PACKAGES

public static final int ONE_OR_MORE_IMPORTED_PACKAGES
messgage level for reporting unqualified classes when there are one or more imported packages

See Also:
Constant Field Values
Constructor Detail

XJavaDoc

public XJavaDoc()
Method Detail

printMemoryStatus

public static void printMemoryStatus()
Dump to sytem out the status of XJavadoc.


replaceProperties

public static java.lang.String replaceProperties(java.lang.String value,
                                                 java.util.Map keys)
Replaces ${xxx} style constructions in the given value with the string value of the corresponding data types. NOTE: This method was taken directly from Ant's source code (org.apache.tools.ant.ProjectHelper) and modified slightly to use a Map instead of a HashMap.

Parameters:
value - The string to be scanned for property references. May be null , in which case this method returns immediately with no effect.
keys - Mapping (String to String) of property names to their values. Must not be null.
Returns:
the original string with the properties replaced, or null if the original string is null.

parsePropertyString

public static void parsePropertyString(java.lang.String value,
                                       java.util.List fragments,
                                       java.util.List propertyRefs)
Parses a string containing ${xxx} style property references into two lists. The first list is a collection of text fragments, while the other is a set of string property names. null entries in the first list indicate a property reference from the second list. NOTE: This method was taken directly from Ant's source code (org.apache.tools.ant.ProjectHelper) with the BuildException throwing removed.

Parameters:
value - Text to parse. Must not be null.
fragments - List to add text fragments to. Must not be null .
propertyRefs - List to add property names to. Must not be null

getSourceClasses

public java.util.Collection getSourceClasses(Predicate predicate)

getSourceClasses

public java.util.Collection getSourceClasses(boolean useNodeParser,
                                             boolean inner)
Deprecated. Call setUseNodeParser() prior to parsing and call the no-arg getSourceClasses() or getSourceClasses(Predicate) with a Predicate that doesn't accept inner classes.

Parameters:
useNodeParser -
inner -
Returns:
A Collection of XClass

getSourceClasses

public java.util.Collection getSourceClasses(boolean useNodeParser)
Deprecated. Call setUseNodeParser() prior to parsing and call the no-arg getSourceClasses()

Parameters:
useNodeParser -
Returns:
A Collection of XClass

getSourceClasses

public java.util.Collection getSourceClasses()
Returns all classes in the registered source sets, including inner classes

Returns:
A Collection of XClass

getSourcePackages

public java.util.Collection getSourcePackages()
Returns the packages of the specified classes during parsing.

Returns:
Describe the return value

getPropertyMap

public java.util.Map getPropertyMap()

getXClass

public XClass getXClass(java.lang.String qualifiedName)
Get the XClass corresponding to the qualifiedName. This can be a class from source, a precompiled class or a primitive. UnknownClass is never returned from this method, unless it has been previously instantiated. IMPORTANT: If the Java source can be located, an instance of SourceClass will be returned. -Even if that file was not among the files in the fileset or sourceset. IMPORTANT: If qualifiedName represents an inner class, an UnknownClass will be returned unless the enclousing "outer" class has been resolved first.

Parameters:
qualifiedName - Fully qualified class name
Returns:
The XClass value

getSourcePackage

public XPackage getSourcePackage(java.lang.String packageName)
Returns the package. The package must be one of the packages of the sources. Other packages, such as java.lang are not available.

Parameters:
packageName -
Returns:
an XPackage, or null if the packageName is not among the sources.

setUseNodeParser

public void setUseNodeParser(boolean useNodeParser)
This method can be called prior to parsing so that all classes are parsed with AST (to make it possible to write the source back to disk)

Parameters:
useNodeParser -

setPropertyMap

public void setPropertyMap(java.util.Map properties)

reset

public void reset()
Deprecated. use reset(boolean).

Resets the caches. Same as calling reset(true).


reset

public void reset(boolean resetTimeStamp)
Resets the caches.

Parameters:
resetTimeStamp - true if timestamps should be reset too.

printLogMessages

public void printLogMessages(java.io.PrintStream out,
                             int level)
Prints the log messages encountered during parsing

Parameters:
out -
level -

addSourceSet

public void addSourceSet(SourceSet sourceSet)
Adds a new set of java sources to be parsed.

Parameters:
sourceSet - a set of java sources.

addAbstractFile

public void addAbstractFile(java.lang.String qualifiedName,
                            AbstractFile file)

updateMethodTag

public XClass updateMethodTag(java.lang.String className,
                              java.lang.String methodNameWithSignature,
                              java.lang.String tagName,
                              java.lang.String parameterName,
                              java.lang.String parameterValue,
                              int tagIndex)
                       throws XJavaDocException
Describe what the method does

Parameters:
className - qualified name of class
tagName - tag name
parameterName - parameter name
parameterValue - new parameter value
tagIndex - index of tag (??)
methodNameWithSignature - method name followed by signature. no spaces. Ex:
doIt(java.lang.String,int)
Returns:
the class corresponding to the className
Throws:
XJavaDocException - If the tag for some reason couldn't be updated

updateClassTag

public XClass updateClassTag(java.lang.String className,
                             java.lang.String tagName,
                             java.lang.String parameterName,
                             java.lang.String parameterValue,
                             int tagIndex)
                      throws XJavaDocException
Describe what the method does

Parameters:
className - Describe what the parameter does
tagName - Describe what the parameter does
parameterName - Describe what the parameter does
parameterValue - Describe what the parameter does
tagIndex - Describe what the parameter does
Returns:
Describe the return value
Throws:
XJavaDocException - Describe the exception

dereferenceProperties

public java.lang.String dereferenceProperties(java.lang.String value)

getTagFactory

public XTagFactory getTagFactory()

registerTags

public void registerTags(java.lang.String classpath)
Registers tags.

Parameters:
classpath - where tags are found.

getEncoding

public java.lang.String getEncoding()
Getter for source file charset.

Returns:
encoding

setEncoding

public void setEncoding(java.lang.String encoding)
Setter for source file charset.


getDocEncoding

public java.lang.String getDocEncoding()
Getter for generated file charset.

Returns:
encoding

setDocEncoding

public void setDocEncoding(java.lang.String docencoding)
Setter for generated file charset.



Copyright © 2002-2004 XDoclet Team. All Rights Reserved.