com.generationjava.util
Class CommentedOrderedProperties

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--java.util.Properties
                    |
                    +--com.generationjava.util.OrderedProperties
                          |
                          +--com.generationjava.util.CommentedOrderedProperties
All Implemented Interfaces:
java.lang.Cloneable, Commentable, java.util.Map, java.io.Serializable

public class CommentedOrderedProperties
extends OrderedProperties
implements Commentable

java.util.Properties stores keys and values, but it does not store them in an ordered way. Annoyingly, there is no easy way to splice this feature in, rather it leads to a rewrite of most of the methods and the creation. This is that rewrite.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.generationjava.util.OrderedProperties
index
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
CommentedOrderedProperties()
           
CommentedOrderedProperties(java.util.Properties props)
           
 
Method Summary
 void addComment(char ch, java.lang.String str)
           
 void addComment(java.lang.String str)
           
 void addSeparator()
           
static CommentedOrderedProperties createCommentedOrderedProperties(java.io.File file)
           
 char getCommentChar()
           
 void insertComment(char ch, java.lang.String str, java.lang.Object key)
           
 java.util.Set keySet()
           
 void save(java.io.OutputStream outstrm, java.lang.String header)
          Currently will write out defaults as well, which is not in the specification.
 void setCommentChar(char ch)
           
 void store(java.io.OutputStream outstrm, java.lang.String header)
          Currently will write out defaults as well, which is not in the specification.
 void wordWrapComment(char ch, java.lang.String str, int width)
           
 
Methods inherited from class com.generationjava.util.OrderedProperties
keys, load, propertyNames, put, remove, setProperty
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, putAll, rehash, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommentedOrderedProperties

public CommentedOrderedProperties()

CommentedOrderedProperties

public CommentedOrderedProperties(java.util.Properties props)
Method Detail

createCommentedOrderedProperties

public static CommentedOrderedProperties createCommentedOrderedProperties(java.io.File file)

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map
Overrides:
keySet in class OrderedProperties

save

public void save(java.io.OutputStream outstrm,
                 java.lang.String header)
Currently will write out defaults as well, which is not in the specification.

Overrides:
save in class OrderedProperties

store

public void store(java.io.OutputStream outstrm,
                  java.lang.String header)
           throws java.io.IOException
Currently will write out defaults as well, which is not in the specification.

Overrides:
store in class OrderedProperties
java.io.IOException

setCommentChar

public void setCommentChar(char ch)
Specified by:
setCommentChar in interface Commentable

getCommentChar

public char getCommentChar()
Specified by:
getCommentChar in interface Commentable

addComment

public void addComment(java.lang.String str)
Specified by:
addComment in interface Commentable

addComment

public void addComment(char ch,
                       java.lang.String str)
Specified by:
addComment in interface Commentable

addSeparator

public void addSeparator()
Specified by:
addSeparator in interface Commentable

wordWrapComment

public void wordWrapComment(char ch,
                            java.lang.String str,
                            int width)
Specified by:
wordWrapComment in interface Commentable

insertComment

public void insertComment(char ch,
                          java.lang.String str,
                          java.lang.Object key)
Specified by:
insertComment in interface Commentable


Copyright © 2000-2003 GenerationJava. All Rights Reserved.