|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.triadsoft.common.properties.PropertyElement
com.triadsoft.common.properties.PropertyFile
public class PropertyFile
Esta clase es la encargada de parsear un archivo de properties, y dividirlo en categorias y entradas. Tambien se puede persistir mediante el metodo save
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_EXTENSION
|
Fields inherited from class com.triadsoft.common.properties.PropertyElement |
---|
NO_CHILDREN |
Constructor Summary | |
---|---|
PropertyFile(java.io.File file)
|
|
PropertyFile(IFile file)
Permite crear un property file a partir de un IFile |
Method Summary | |
---|---|
void |
addCategory(PropertyCategory category)
|
void |
addPropertyFileListener(IPropertyFileListener listener)
|
java.lang.String |
asText()
Convierte el PropertyFile en texto |
void |
categoryAdded(PropertyCategory category)
|
void |
categoryRemoved(PropertyCategory category)
|
void |
entryAdded(PropertyCategory category,
PropertyEntry entry)
|
void |
entryRemoved(PropertyCategory category,
PropertyEntry entry)
|
boolean |
exist(java.lang.String propertyName)
Devuelve verdadero si existe la propiedad en el archivo |
boolean |
existCategory(java.lang.String categoryName)
Devuelve true, si existe una categoria con este nombre |
void |
fileChanged(PropertyFile propertyFile)
|
PropertyCategory |
getCategoryByName(java.lang.String categoryName)
Devuelve una categoria a partir de su nombre |
PropertyCategory |
getCategoryFromEntry(java.lang.String entryKey)
Devuelve la categoria a partir del key buscado |
PropertyElement[] |
getChildren()
|
PropertyCategory |
getDefaultCategory()
Devuelve la categoria por default. |
PropertyEntry[] |
getEntries()
|
IFile |
getFile()
|
java.lang.String[] |
getKeys()
|
int |
getLine()
|
PropertyEntry |
getPropertyEntry(java.lang.String entryKey)
Devuelve el objeto PropertyEntry a partir de la clave |
boolean |
hasChildren()
|
void |
keyChanged(PropertyCategory category,
PropertyEntry entry)
|
static void |
main(java.lang.String[] args)
|
boolean |
moveToCategory(PropertyEntry entry,
PropertyCategory destinityCategory)
Mueve un entrada a un categoria |
void |
nameChanged(PropertyCategory category)
|
void |
removeCategory(PropertyCategory category)
|
void |
removeFromParent()
|
void |
removePropertyFileListener(IPropertyFileListener listener)
|
void |
resourceChanged(IResourceChangeEvent event)
|
void |
save()
|
void |
setFile(IFile file)
|
void |
valueChanged(PropertyCategory category,
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, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_EXTENSION
Constructor Detail |
---|
public PropertyFile(java.io.File file) throws java.io.IOException
file
-
java.io.IOException
public PropertyFile(IFile file) throws java.io.IOException
file
-
java.io.IOException
Method Detail |
---|
public PropertyElement[] getChildren()
getChildren
in class PropertyElement
public void addCategory(PropertyCategory category)
public void removeCategory(PropertyCategory category)
public void removeFromParent()
removeFromParent
in class PropertyElement
public void addPropertyFileListener(IPropertyFileListener listener)
public void removePropertyFileListener(IPropertyFileListener listener)
public void keyChanged(PropertyCategory category, PropertyEntry entry)
keyChanged
in interface IPropertyFileListener
public void valueChanged(PropertyCategory category, PropertyEntry entry)
valueChanged
in interface IPropertyFileListener
public void nameChanged(PropertyCategory category)
nameChanged
in interface IPropertyFileListener
public void entryAdded(PropertyCategory category, PropertyEntry entry)
entryAdded
in interface IPropertyFileListener
public void entryRemoved(PropertyCategory category, PropertyEntry entry)
entryRemoved
in interface IPropertyFileListener
public void categoryAdded(PropertyCategory category)
categoryAdded
in interface IPropertyFileListener
public void categoryRemoved(PropertyCategory category)
categoryRemoved
in interface IPropertyFileListener
public boolean hasChildren()
hasChildren
in class PropertyElement
PropertyElement.hasChildren()
public boolean existCategory(java.lang.String categoryName)
categoryName
-
public boolean exist(java.lang.String propertyName)
propertyName
-
public java.lang.String asText()
public PropertyCategory getDefaultCategory()
PropertyCategory
public IFile getFile()
public void setFile(IFile file)
public void resourceChanged(IResourceChangeEvent event)
public PropertyCategory getCategoryByName(java.lang.String categoryName)
categoryName
- Nombre de la categoria buscada
public PropertyCategory getCategoryFromEntry(java.lang.String entryKey)
entryKey
-
public PropertyEntry getPropertyEntry(java.lang.String entryKey)
entryKey
- String que identifica a la entrada
public boolean moveToCategory(PropertyEntry entry, PropertyCategory destinityCategory)
entry
- destinityCategory
- public int getLine()
getLine
in class PropertyElement
PropertyElement.getLine()
public PropertyEntry[] getEntries()
public java.lang.String[] getKeys()
public void save() throws java.io.IOException, CoreException
java.io.IOException
CoreException
public static void main(java.lang.String[] args)
public void fileChanged(PropertyFile propertyFile)
fileChanged
in interface IPropertyFileListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |