|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gentics.api.lib.resolving.PropertyResolver
com.gentics.api.lib.resolving.PropertySetter
public class PropertySetter
PropertySetter is an extension of PropertyResolver
that also can
change properties by paths based on a given Resolvable
. The setting
process resolves the given property path up to the next to last path part.
When the result of this is a Changeable
or a Collection of
Changeables, the objects are modified by setting the property given by the
last part of the property path.
Example: let the base object be a
Resolvable
representing a user. The call to
setProperty(String, Object)
with ("organisation.employees.email",
"a.b@foo.com") would first resolve "organisation.employees" to a
Collection
of Changeable
s representing all employees of the
user's organisation and would then change the email addresses by calling
Changeable.setProperty(String, Object)
with ("email", "a.b@foo.com")
for each.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.gentics.api.lib.resolving.PropertyResolver |
---|
PropertyResolver.PropertyPathEntry |
Field Summary |
---|
Fields inherited from class com.gentics.api.lib.resolving.PropertyResolver |
---|
m_startObject |
Constructor Summary | |
---|---|
PropertySetter(Resolvable baseObject)
Create a propertySetter that resolves and sets properties based on the given Resolvable. |
Method Summary | |
---|---|
void |
addToProperty(String path,
Object value)
Add the given property to the properties resolved by the given path. |
void |
addToProperty(String path,
Object value,
boolean allowDuplicates)
Add the given property to the properties resolved by the given path. |
void |
performAssignment(Expression expression)
Perform the given assignment expression |
protected void |
remove(Collection toModify,
Object toRemove)
Remove the given object from the given collection. |
protected void |
removeAll(Collection toModify,
Collection toRemove)
Remove all objects in the collection from the given collection. |
void |
removeFromProperty(String path,
Object value)
Remove the given value from the properties resolved by the given path. |
void |
setProperty(String path,
Object value)
Set the property (properties) given by the path to the given value |
Methods inherited from class com.gentics.api.lib.resolving.PropertyResolver |
---|
canResolve, get, getProperty, resolve, resolve, resolve, resolve, resolvePath, resolvePath, resolvePath |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertySetter(Resolvable baseObject)
baseObject
- base objectMethod Detail |
---|
public void setProperty(String path, Object value) throws UnknownPropertyException, InsufficientPrivilegesException
path
- path to a property/properties of an object/objectsvalue
- new value to set
UnknownPropertyException
InsufficientPrivilegesException
public void addToProperty(String path, Object value) throws UnknownPropertyException, InsufficientPrivilegesException
path
- property pathvalue
- value to add
UnknownPropertyException
InsufficientPrivilegesException
public void addToProperty(String path, Object value, boolean allowDuplicates) throws UnknownPropertyException, InsufficientPrivilegesException
path
- property pathvalue
- value to addallowDuplicates
- true when duplicates are allowed, false if not
UnknownPropertyException
InsufficientPrivilegesException
public void removeFromProperty(String path, Object value) throws UnknownPropertyException, InsufficientPrivilegesException
path
- path of the propertyvalue
- value to remove
UnknownPropertyException
InsufficientPrivilegesException
public void performAssignment(Expression expression) throws ExpressionParserException
expression
- assignment expression
ExpressionParserException
protected void remove(Collection toModify, Object toRemove)
toModify
- collection to modifytoRemove
- object to removeprotected void removeAll(Collection toModify, Collection toRemove)
toModify
- collection to modifytoRemove
- collection of objects to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |