public class BinaryPropertyAccessor extends PropertyAccessor<Propertyable,BinaryProperty,byte[]>
Modifier and Type | Class and Description |
---|---|
static class |
BinaryPropertyAccessor.DummyPropertyable
Dummy class since binary properties are not bound to any context
|
Modifier and Type | Field and Description |
---|---|
static BinaryPropertyAccessor.DummyPropertyable |
DUMMY_OBJECT
DUMMY Object since the binary properties are not bound to a object instance
|
Constructor and Description |
---|
BinaryPropertyAccessor(EventDispatcher eventDispatcher) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertReadAccess(Propertyable propertyable)
Asserts valid read access for the given object.
|
protected boolean |
assertValidForCreateAndUpdate(String keyGroup,
String key)
Check that the group and key are both set and that the filters allow setting the property
|
protected void |
assertWriteAccess(Propertyable propertyable)
Does nothing.
|
Date |
getLastModificationDate(String keyGroup,
String key)
Get last modification date of a binary property.
|
protected Long |
getObjectId(Propertyable object) |
PropertyType |
getPropertyType() |
protected BinaryProperty |
handleCreateNewProperty(Propertyable object)
Create a new property and associate it with the object
|
protected BinaryProperty |
handleGetObjectPropertyUnfiltered(Propertyable object,
String keyGroup,
String key)
Get an object property for the given group and key
|
protected void |
handleRemoveObjectProperty(Propertyable object,
String keyGroup,
String key)
Removes the property of an object
|
boolean |
hasProperty(Propertyable object,
String keyGroup,
String key) |
protected Propertyable |
load(Long id) |
void |
removeProperty(String keyGroup,
String key)
Removes the given property.
|
protected void |
setPropertyValue(BinaryProperty property,
byte[] value) |
addToFilterDefinition, assertLoadObject, getFilterDefintion, getGlobalObjectProperty, getObjectProperty, getObjectPropertyUnfiltered, handleSetObjectProperty, handleSetObjectPropertyUnfiltered, removeFromFilterDefinition, removeObjectProperty, setGlobalObjectProperty, setObjectProperty, setObjectPropertyUnfiltered
public static final BinaryPropertyAccessor.DummyPropertyable DUMMY_OBJECT
public BinaryPropertyAccessor(EventDispatcher eventDispatcher)
eventDispatcher
- the event dispatcher for dispatching event on property changesprotected void assertReadAccess(Propertyable propertyable)
Does nothing, as everyone is allowed to read binary properties.
assertReadAccess
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
propertyable
- The object.protected boolean assertValidForCreateAndUpdate(String keyGroup, String key)
PropertyAccessor
assertValidForCreateAndUpdate
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
keyGroup
- the key group of the propertykey
- the key of the propertyprotected void assertWriteAccess(Propertyable propertyable)
assertWriteAccess
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
propertyable
- Not used.public Date getLastModificationDate(String keyGroup, String key)
keyGroup
- group of the property keykey
- the key of the propertyprotected Long getObjectId(Propertyable object)
getObjectId
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
object
- the object the property is / will be assigned topublic PropertyType getPropertyType()
getPropertyType
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
protected BinaryProperty handleCreateNewProperty(Propertyable object)
handleCreateNewProperty
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
object
- the object to add a new property toprotected BinaryProperty handleGetObjectPropertyUnfiltered(Propertyable object, String keyGroup, String key)
handleGetObjectPropertyUnfiltered
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
object
- the object to get the property ofkeyGroup
- the key group of the property to getkey
- the key of the propert no such property existsprotected void handleRemoveObjectProperty(Propertyable object, String keyGroup, String key) throws AuthorizationException
PropertyAccessor
handleRemoveObjectProperty
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
object
- object to get the property ofkeyGroup
- the key group of the property to getkey
- the key of the propertyAuthorizationException
- Thrown, when the user is not allowed to access.public boolean hasProperty(Propertyable object, String keyGroup, String key)
object
- The object.keyGroup
- The keygroup.key
- The key.protected Propertyable load(Long id)
load
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
id
- the id of the objectpublic void removeProperty(String keyGroup, String key)
keyGroup
- The group of the property keykey
- The key of the propertyprotected void setPropertyValue(BinaryProperty property, byte[] value)
setPropertyValue
in class PropertyAccessor<Propertyable,BinaryProperty,byte[]>
property
- The property.value
- The value.Copyright © 2019 Communote team. All rights reserved.