com.fullspan.propkeyconst.descriptor
Class ConstantDesc
java.lang.Object
com.fullspan.propkeyconst.descriptor.ConstantDesc
- All Implemented Interfaces:
- ICommentHolder
- public class ConstantDesc
- extends java.lang.Object
- implements ICommentHolder
A constant descriptor. A constant represents a property key in a
way that ensures type safety and adds convenience.
For example, instead of using a String like "form.user.loginid",
a constant can be referenced as (for example)
MyPropKeys.FORM.USER.LOGINID. This allows
- The value of the constant to be checked at compile time (otherwise
it would not be checked until runtime, and even then it might only be
checked if certain code paths are executed).
- Development environments will perform auto-completion of the
constant variable name, making programming with property keys more
convenient.
The ConstantDesc may have a comment associated with it.
- Author:
- Mitch Stuart
- See Also:
ICommentHolder
|
Constructor Summary |
ConstantDesc(java.lang.String propKey,
java.lang.String value)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONSTANT_NAME_COMPARATOR
public static final java.util.Comparator CONSTANT_NAME_COMPARATOR
ConstantDesc
public ConstantDesc(java.lang.String propKey,
java.lang.String value)
getDottedClassName
public java.lang.String getDottedClassName()
getName
public java.lang.String getName()
getPropKey
public java.lang.String getPropKey()
getValue
public java.lang.String getValue()
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)