|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.exist.fluent.AttributeBuilder
public class AttributeBuilder
Allows attributes to be added to, replaced in and removed from an existing
element in the database. The updates are batched for efficiency; you must call
commit() to apply them to the database.
| Method Summary | |
|---|---|
AttributeBuilder |
attr(String name,
Object value)
Create a new attribute or change the value of an existing one. |
AttributeBuilder |
attrIf(boolean condition,
String name,
Object value)
Add an attribute or change an existing attribute's value only if the given condition holds. |
void |
commit()
Commit the attribute changes recorded with the other methods to the database. |
AttributeBuilder |
delAttr(String name)
Delete an attribute. |
AttributeBuilder |
namespace(String key,
String uri)
Add a namespace binding to this builder's namespaces map. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public AttributeBuilder namespace(String key,
String uri)
key - the prefix to binduri - the URI to bind it to
public AttributeBuilder attr(String name,
Object value)
name - the name of the attributevalue - the value of the attribute, if not a String will be converted using DataUtils.toXMLString(Object)
public AttributeBuilder attrIf(boolean condition,
String name,
Object value)
attr(String, Object) if condition is true, does
nothing otherwise.
condition - the condition that must be satisfied before the attribute's value is setname - the name of the attributevalue - the value of the attribute
public AttributeBuilder delAttr(String name)
attr(String, Object), even if not
yet committed.
name - the name of the attribute to delete
public void commit()
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||