public class PropertiesFileContent extends OrderedProperties<org.pfsw.file.PropertiesFileElement>
INITIAL_CAPACITY
Constructor and Description |
---|
PropertiesFileContent()
Initialize the new instance with default values.
|
PropertiesFileContent(int initialCapacity)
Initialize the new instance with an initial capacity.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addElement(org.pfsw.file.PropertiesFileElement element) |
void |
addLine(java.lang.String line)
Adds the given line at the end of all contained elements
|
boolean |
addProperty(IName name,
java.lang.String value)
Adds the property with the specified name and value.
|
boolean |
addProperty(java.lang.String name,
java.lang.String value)
Adds the property with the specified name and value.
|
boolean |
commentProperty(IName name)
Turns the property specified by the given name to a comment.
|
boolean |
commentProperty(java.lang.String name)
Turns the property specified by the given name to a comment.
|
protected org.pfsw.file.PropertiesFileElement |
elementAt(int index) |
protected org.pfsw.file.PropertiesFileElement |
elementAt(java.lang.Integer index) |
protected org.pfsw.file.PropertiesFileElement |
findPropertyElement(java.lang.String key) |
protected java.util.List<java.lang.Integer> |
getCommentIndex() |
protected boolean |
isValidProperty(org.pfsw.file.PropertiesFileElement property) |
boolean |
modifyProperty(IName name,
java.lang.String newValue)
Modifies the value of the property specified by the given name.
|
boolean |
modifyProperty(java.lang.String name,
java.lang.String newValue)
Modifies the value of the property specified by the given name.
|
protected org.pfsw.file.PropertiesFileElement |
newProperty(java.lang.String name,
java.lang.String value)
Create a new property object with the given name and value.
|
protected void |
registerComment(java.lang.Integer index) |
boolean |
renameProperty(IName name,
IName newName)
Renames the the property specified with the given name to the specified new name.
|
boolean |
renameProperty(java.lang.String name,
java.lang.String newName)
Renames the the property specified with the given name to the specified new name.
|
protected void |
setCommentIndex(java.util.List<java.lang.Integer> newValue) |
java.lang.Object |
setProperty(java.lang.String name,
java.lang.String value)
Modifies the value or adds the property specified by the given name.
|
boolean |
uncommentProperty(IName name)
Changes a comment containing the property specified by the given name
to a real property setting, by removing the leading comment indicator '#'.
|
boolean |
uncommentProperty(java.lang.String name)
Changes a comment containing the property specified by the given name
to a real property setting, by removing the leading comment indicator '#'.
|
appendProperty, clear, deleteProperty, deleteProperty, entrySet, findProperty, getElements, getProperty, getProperty, getProperty, getProperty, getPropertyIndex, getPropertyNames, hasContent, indexOfProperty, isEmpty, isNullOrDeleted, keys, keySet, list, list, load, nameList, newElementsList, numberOfElements, propertyAt, propertyAt, propertyNames, registerProperty, remove, save, setElements, setProperty, setPropertyIndex, size, store, stringPropertyNames
public PropertiesFileContent()
public PropertiesFileContent(int initialCapacity)
public void addLine(java.lang.String line)
public java.lang.Object setProperty(java.lang.String name, java.lang.String value)
setProperty
in class OrderedProperties<org.pfsw.file.PropertiesFileElement>
name
- The name of the property to setvalue
- The new value to be setpublic boolean modifyProperty(java.lang.String name, java.lang.String newValue)
name
- The name of the property to modifynewValue
- The new value to be setpublic boolean modifyProperty(IName name, java.lang.String newValue)
name
- The name of the property to modifynewValue
- The new value to be setpublic boolean renameProperty(java.lang.String name, java.lang.String newName)
name
- The name of the property to rename.newName
- The new name to be set.public boolean renameProperty(IName name, IName newName)
name
- The name of the property to rename.newName
- The new name to be set.public boolean addProperty(java.lang.String name, java.lang.String value)
name
- The name of the property to add.value
- The value to be set.public boolean addProperty(IName name, java.lang.String value)
name
- The name of the property to add.value
- The value to be set.public boolean commentProperty(java.lang.String name)
name
- The name of the property to change to be a comment.public boolean commentProperty(IName name)
name
- The name of the property to change to be a comment.public boolean uncommentProperty(java.lang.String name)
name
- The name of the property to change from a comment to a property.public boolean uncommentProperty(IName name)
name
- The name of the property to change from a comment to a property.protected org.pfsw.file.PropertiesFileElement newProperty(java.lang.String name, java.lang.String value)
newProperty
in class OrderedProperties<org.pfsw.file.PropertiesFileElement>
protected void addElement(org.pfsw.file.PropertiesFileElement element)
addElement
in class OrderedProperties<org.pfsw.file.PropertiesFileElement>
protected org.pfsw.file.PropertiesFileElement findPropertyElement(java.lang.String key)
protected org.pfsw.file.PropertiesFileElement elementAt(java.lang.Integer index)
protected org.pfsw.file.PropertiesFileElement elementAt(int index)
protected void registerComment(java.lang.Integer index)
protected boolean isValidProperty(org.pfsw.file.PropertiesFileElement property)
isValidProperty
in class OrderedProperties<org.pfsw.file.PropertiesFileElement>
protected java.util.List<java.lang.Integer> getCommentIndex()
protected void setCommentIndex(java.util.List<java.lang.Integer> newValue)