|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.util.XMLJiveProperties
public class XMLJiveProperties
Provides the the ability to use simple XML property files. Each property is in the form X.Y.Z, which would map to an XML snippet of:
<X> <Y> <Z>someValue</Z> </Y> </X>The XML file is passed in to the constructor and must be readable and writtable. Setting property values will automatically persist those value to disk. The file encoding used is UTF-8.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
XMLJiveProperties(java.io.InputStream in)
Creates a properties object given an input stream of valid XML. |
|
XMLJiveProperties(java.lang.String fileName)
Creates a new XMLJiveProperties object from the given file of XML. |
Method Summary | |
---|---|
void |
clear()
|
boolean |
containsKey(java.lang.Object object)
|
boolean |
containsValue(java.lang.Object object)
|
java.util.Set |
entrySet()
|
java.lang.Object |
get(java.lang.Object o)
Returns the value of the specified property. |
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String attribute)
Returns the value of the attribute of the given property name or null if it doesn't exist. |
java.util.Collection |
getChildrenNames(java.lang.String parent)
Return all children property names of a parent property as a Collection
of String objects. |
java.lang.String |
getProperty(java.lang.String name)
|
java.util.Collection |
getPropertyNames()
Returns all property names as a Collection of String values. |
boolean |
isEmpty()
|
java.util.Set |
keySet()
|
java.lang.Object |
put(java.lang.Object k,
java.lang.Object v)
Sets the value of the specified property. |
void |
putAll(java.util.Map propertyMap)
Sets multiple properties at once. |
java.lang.Object |
remove(java.lang.Object n)
Deletes the specified property. |
int |
size()
|
java.util.Collection |
values()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public XMLJiveProperties(java.io.InputStream in) throws java.lang.Exception
in
- an input stream of XML.
java.lang.Exception
- if an exception occurs while parsing.public XMLJiveProperties(java.lang.String fileName) throws java.io.IOException
fileName
- the full path the file that properties should be read from and written to.
java.io.IOException
- if an exception occurs reading or parsing the file.Method Detail |
---|
public java.lang.Object get(java.lang.Object o)
get
in interface java.util.Map
o
- the name of the property to get.
public java.util.Collection getChildrenNames(java.lang.String parent)
JiveProperties
Collection
of String objects. For example, given the properties X.Y.A,
X.Y.B, and X.Y.C, then the child properties of
X.Y are X.Y.A, X.Y.B, and X.Y.C. The method
is not recursive; ie, it does not return children of children.
getChildrenNames
in interface JiveProperties
parent
- the name of the parent property.
public java.util.Collection getPropertyNames()
JiveProperties
Collection
of String values.
getPropertyNames
in interface JiveProperties
public java.lang.String getAttribute(java.lang.String name, java.lang.String attribute)
name
- the property name to lookup - ie, "foo.bar"attribute
- the name of the attribute, ie "id"
public java.lang.Object put(java.lang.Object k, java.lang.Object v)
put
in interface java.util.Map
k
- the name of the property to set.v
- the new value for the property.public void putAll(java.util.Map propertyMap)
putAll
in interface java.util.Map
propertyMap
- a map of properties, keyed on property name.public java.lang.Object remove(java.lang.Object n)
remove
in interface java.util.Map
n
- the property to delete.public java.lang.String getProperty(java.lang.String name)
public boolean containsKey(java.lang.Object object)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object object)
containsValue
in interface java.util.Map
public java.util.Collection values()
values
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public int size()
size
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public void clear()
clear
in interface java.util.Map
public java.util.Set keySet()
keySet
in interface java.util.Map
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |