com.generationjava.util
Class CommentedOrderedProperties

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended bycom.generationjava.util.OrderedProperties
                  extended bycom.generationjava.util.CommentedOrderedProperties
All Implemented Interfaces:
Cloneable, Map, Serializable

public class CommentedOrderedProperties
extends OrderedProperties

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(Properties props)
           
 
Method Summary
 void addComment(char ch, String str)
           
 void addComment(String str)
           
 void addSeparator()
           
static CommentedOrderedProperties createCommentedOrderedProperties(File file)
           
 char getCommentChar()
           
 void insertComment(char ch, String str, Object key)
           
 Set keySet()
           
 void save(OutputStream outstrm, String header)
          Currently will write out defaults as well, which is not in the specification.
 void setCommentChar(char ch)
           
 void store(OutputStream outstrm, String header)
          Currently will write out defaults as well, which is not in the specification.
 void wordWrapComment(char ch, 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(Properties props)
Method Detail

createCommentedOrderedProperties

public static CommentedOrderedProperties createCommentedOrderedProperties(File file)

keySet

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

save

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

Overrides:
save in class OrderedProperties

store

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

Overrides:
store in class OrderedProperties
Throws:
IOException

setCommentChar

public void setCommentChar(char ch)

getCommentChar

public char getCommentChar()

addComment

public void addComment(String str)

addComment

public void addComment(char ch,
                       String str)

addSeparator

public void addSeparator()

wordWrapComment

public void wordWrapComment(char ch,
                            String str,
                            int width)

insertComment

public void insertComment(char ch,
                          String str,
                          Object key)


Copyright © 2000-2005 OSJava. All Rights Reserved.