|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.gouv.culture.sdx.utils.database.DatabaseEntity
public class DatabaseEntity
An entity from a _database, basically a list of properties.
The entity is the database basic unit of management. It can have properties, all properties have a unique name but a property may have multiple values.
TODO?: this class is not completely implemented.
Constructor Summary | |
---|---|
DatabaseEntity(java.lang.String id)
Creates an instance with the specified id |
Method Summary | |
---|---|
void |
addProperties(java.lang.String name,
java.lang.String[] values)
Adds or updates a property with a list of values to a DatabaseEntity. |
void |
addProperty(java.lang.String name,
java.lang.String value)
|
boolean |
containsProperty(java.lang.String name)
|
boolean |
containsValue(java.lang.String propertyName,
java.lang.String propertyValue)
|
void |
deleteProperty(java.lang.String name)
Deletes a properties object |
void |
deleteValue(java.lang.String propertyName,
java.lang.String value)
Delete a valud from a property of this entity |
void |
dump(java.io.PrintStream ps)
Dumps a debug info of this object. |
void |
enableLogging(org.apache.avalon.framework.logger.Logger logger)
Sets the super.getLog(). |
java.lang.String |
getId()
Returns the id for this entity |
Property[] |
getProperties()
Get's all the ContextKeys of this Database Entity |
java.lang.String |
getProperty(java.lang.String name)
Get's the first value of the Property specified by a name |
java.lang.String[] |
getPropertyValues(java.lang.String name)
Get's the values of a of the Property specified by a name |
void |
setId(java.lang.String id)
Modifies the id for this entity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatabaseEntity(java.lang.String id) throws SDXException
id
- The id to assign to this entity
SDXException
Method Detail |
---|
public java.lang.String getId()
public void setId(java.lang.String id)
public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
enableLogging
in interface org.apache.avalon.framework.logger.LogEnabled
logger
- The super.getLog() to use.public void addProperty(java.lang.String name, java.lang.String value)
public void addProperties(java.lang.String name, java.lang.String[] values)
If a property by the name specified already exists, the values are added to the property's list of values, if one wishes to replace the existing property, the property should be deleted first using the deleteProperty(String name) in this class, and then re-add the property
name
- The name to assign to the Propertyvalues
- An array of String values for the propertypublic java.lang.String getProperty(java.lang.String name)
name
- The name of an existing the Property
public java.lang.String[] getPropertyValues(java.lang.String name)
name
- The name of an existing the Property
public Property[] getProperties()
public void deleteProperty(java.lang.String name) throws SDXException
name
- The name of the property to be deleted
SDXException
- If the name is null or an empty String.public void deleteValue(java.lang.String propertyName, java.lang.String value) throws SDXException
propertyName
- The propertynamevalue
- The value to delete
SDXException
public void dump(java.io.PrintStream ps)
public boolean containsProperty(java.lang.String name)
public boolean containsValue(java.lang.String propertyName, java.lang.String propertyValue)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |