com.triadsoft.common.properties
Class PropertyCategory

java.lang.Object
  extended by com.triadsoft.common.properties.PropertyElement
      extended by com.triadsoft.common.properties.PropertyCategory

public class PropertyCategory
extends PropertyElement

Clase que modela una categoria. Una categoria dentro de un archivo de propiedades es un agrupamiento de las claves y valores delimitado por los comentarios hechos dentro del archivo de propiedades. El contenido entre comentarios, es parseado dentro de la categoria, y ésta toma como nombre el comentatio utilizado.
La idea de las categorias no es mia, sino que fue tomada del ejemplo del libro Eclipse Plugins

Author:
Triad (flores.leonardo@triadsoft.com.ar)
See Also:
Eclipse Plugins

Field Summary
 
Fields inherited from class com.triadsoft.common.properties.PropertyElement
NO_CHILDREN
 
Constructor Summary
PropertyCategory(PropertyFile parent, java.io.LineNumberReader reader)
           
PropertyCategory(PropertyFile parent, java.lang.String name)
           
 
Method Summary
 void addEntry(PropertyEntry entry)
           
 void appendText(java.io.PrintWriter writer)
           
 boolean existEntry(java.lang.String entryValue)
          Devuelve un booleano que indica si la clave existe en esta categoria
 PropertyElement[] getChildren()
           
 java.util.Collection<PropertyEntry> getEntries()
           
 PropertyEntry getEntry(java.lang.String entryKey)
           
 int getLine()
           
 java.lang.String getName()
           
 boolean hasChildren()
           
 void keyChanged(PropertyEntry entry)
           
 void removeEntry(PropertyEntry entry)
           
 void removeFromParent()
           
 void setName(java.lang.String text)
           
 java.lang.String toString()
           
 void valueChanged(PropertyEntry entry)
           
 
Methods inherited from class com.triadsoft.common.properties.PropertyElement
getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyCategory

public PropertyCategory(PropertyFile parent,
                        java.lang.String name)

PropertyCategory

public PropertyCategory(PropertyFile parent,
                        java.io.LineNumberReader reader)
                 throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getName

public java.lang.String getName()

getEntries

public java.util.Collection<PropertyEntry> getEntries()

getEntry

public PropertyEntry getEntry(java.lang.String entryKey)

getChildren

public PropertyElement[] getChildren()
Specified by:
getChildren in class PropertyElement

setName

public void setName(java.lang.String text)

addEntry

public void addEntry(PropertyEntry entry)

removeEntry

public void removeEntry(PropertyEntry entry)

removeFromParent

public void removeFromParent()
Specified by:
removeFromParent in class PropertyElement

keyChanged

public void keyChanged(PropertyEntry entry)

valueChanged

public void valueChanged(PropertyEntry entry)

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in class PropertyElement
See Also:
PropertyElement.hasChildren()

appendText

public void appendText(java.io.PrintWriter writer)

existEntry

public boolean existEntry(java.lang.String entryValue)
Devuelve un booleano que indica si la clave existe en esta categoria

Parameters:
entryValue -
Returns:
Boolean TRUE o FALSE

getLine

public int getLine()
Specified by:
getLine in class PropertyElement

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object