com.fullspan.propkeyconst.descriptor
Class ClassDesc

java.lang.Object
  extended bycom.fullspan.propkeyconst.descriptor.ClassDesc
All Implemented Interfaces:
ICommentHolder
Direct Known Subclasses:
RootClassDesc

public class ClassDesc
extends java.lang.Object
implements ICommentHolder

Descriptor of a class that contains Constants for property keys, and Inner Classes.

The ClassDesc may have a comment associated with it.

Author:
Mitch Stuart
See Also:
ICommentHolder

Nested Class Summary
static class ClassDesc.ClassNameComparator
          Compares two ClassDesc instances by comparing their name properties.
 
Field Summary
static java.util.Comparator CLASS_NAME_COMPARATOR
          A singleton instance of $ClassDesc.ClassNameComparator
 
Method Summary
 void addConstantDesc(ConstantDesc constantDesc)
           
protected  ClassDesc getClassDesc(java.lang.String[] containingClassNames, int index, boolean create)
           
 CommentDesc getCommentDesc()
           
 ConstantDesc getConstantDesc(java.lang.String name)
           
 java.util.List getConstantDescList()
          Gets the list of ConstantDescs, sorted by the name of each constant.
 boolean getHasComment()
           
 java.util.List getInnerClassDescList()
          Gets the list of inner ClassDescs, sorted by the name of each inner class.
 int getLevel()
          Returns the nesting level of this ClassDesc.
 java.lang.String getName()
           
 void setCommentDesc(CommentDesc commentDesc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME_COMPARATOR

public static final java.util.Comparator CLASS_NAME_COMPARATOR
A singleton instance of $ClassDesc.ClassNameComparator

Method Detail

getLevel

public int getLevel()
Returns the nesting level of this ClassDesc. The nesting level is 0 for the root, 1 for a class nested within the root, 2 for the next level, and so on.

Returns:
the nesting level

getName

public java.lang.String getName()

addConstantDesc

public void addConstantDesc(ConstantDesc constantDesc)

getConstantDesc

public ConstantDesc getConstantDesc(java.lang.String name)
Parameters:
name - the name of the constant (not the dotted name, just the base name)
Returns:
the named ConstantDesc, or null if there is no such ConstantDesc

getConstantDescList

public java.util.List getConstantDescList()
Gets the list of ConstantDescs, sorted by the name of each constant.

Returns:
the list of ConstantDescs within this ClassDesc

getInnerClassDescList

public java.util.List getInnerClassDescList()
Gets the list of inner ClassDescs, sorted by the name of each inner class.

Returns:
the list of inner ClassDescs within this ClassDesc

getClassDesc

protected ClassDesc getClassDesc(java.lang.String[] containingClassNames,
                                 int index,
                                 boolean create)

getCommentDesc

public CommentDesc getCommentDesc()
Specified by:
getCommentDesc in interface ICommentHolder
See Also:
ICommentHolder.getCommentDesc()

getHasComment

public boolean getHasComment()
Specified by:
getHasComment in interface ICommentHolder
See Also:
ICommentHolder.getHasComment()

setCommentDesc

public void setCommentDesc(CommentDesc commentDesc)
Specified by:
setCommentDesc in interface ICommentHolder
See Also:
ICommentHolder.setCommentDesc(com.fullspan.propkeyconst.descriptor.CommentDesc)