public class Metadata
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
Metadata()
Default constructor.
|
Metadata(Metadata m)
creates this object as a copy of the argument.
|
Metadata(java.lang.String name)
Creates a new Metadata object with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears this Metadata object of all properties.
|
Metadata |
clone() |
boolean |
containsKey(java.lang.String key)
Returns true if contains a property for the given key.
|
java.lang.String |
getName()
returns the name of this Metadata object.
|
java.lang.String |
getProperty(java.lang.String key)
Returns the property value associated with the key.
|
java.util.Iterator<java.lang.String> |
iterator()
Returns an Iterator over all the properties names.
|
void |
load(java.io.InputStream inStream) |
void |
load(java.io.Reader reader) |
void |
load(java.lang.String str)
Creates a StringReader and uses the load(Reader) method.
|
void |
merge(Metadata m)
adds all the key/values in the argument to this Metadata object.
|
java.util.Set<java.lang.String> |
propertyNames()
Returns a Set of all the property names in this object.
|
java.lang.String |
remove(java.lang.String key)
Removes the property associated with the given key.
|
void |
setName(java.lang.String name)
Sets the name of this Metadata object.
|
java.lang.String |
setProperty(java.lang.String key,
java.lang.String value)
Sets the property with given key to the given value.
|
java.lang.String |
toString() |
java.lang.String |
toXML(java.lang.String indent)
returns a String representation of this Metadata object in XML form.
|
public Metadata()
public Metadata(java.lang.String name)
name
- the Metadata object's name.public Metadata(Metadata m)
m
- the Metadata to copy.public Metadata clone()
clone
in class java.lang.Object
public void merge(Metadata m)
m
- the Metadata to merge with.public void setName(java.lang.String name)
name
- the name to set.public java.lang.String getName()
public java.lang.String toXML(java.lang.String indent)
public void load(java.io.Reader reader) throws java.io.IOException
java.io.IOException
Properties#load(Reader)}
public void load(java.io.InputStream inStream) throws java.io.IOException
java.io.IOException
Properties#load(InputStream)}
public void load(java.lang.String str) throws java.io.IOException
java.io.IOException
Properties#load(Reader)}
public java.util.Set<java.lang.String> propertyNames()
public java.util.Iterator<java.lang.String> iterator()
public java.lang.String getProperty(java.lang.String key)
key
- the property name.public java.lang.String setProperty(java.lang.String key, java.lang.String value)
key
- the property's name.value
- the property's value.public boolean containsKey(java.lang.String key)
key
- the key to search for.public void clear()
public java.lang.String remove(java.lang.String key)
key
- the key to remove.public java.lang.String toString()
toString
in class java.lang.Object