public abstract class EntityPropertyCore extends Object implements EntityProperty, PropertyChangedListener
Constructor and Description |
---|
EntityPropertyCore(String name,
Class type,
Entity owner)
Creates an instance of the
EntityProperty class with the provided arguments. |
Modifier and Type | Method and Description |
---|---|
void |
addCommitListener(EntityPropertyCommitListener listener) |
void |
addOnChangedListener(EntityPropertyChangedListener listener)
Use to add an implementation of the
EntityPropertyChangedListener interface to the
collection of objects that listen for changes of the value of this property. |
void |
addValidationCompletedListener(ValidationCompletedListener listener) |
void |
commit()
Persists the validated value candidate on the source object's property.
|
int |
getColumnPosition() |
int |
getColumnSpan() |
PropertyConverter |
getConverter() |
int |
getCoreEditorLayoutId() |
Object |
getCustomMetadata() |
int |
getEditorLayoutId() |
HashMap<String,Object> |
getEditorParams() |
Class<? extends EntityPropertyEditor> |
getEditorType() |
Object[] |
getEnumConstants() |
String |
getGroupName() |
String |
getHeader() |
int |
getHeaderLayoutId() |
String |
getHintText() |
int |
getImageResource() |
Entity |
getOwner() |
int |
getPosition() |
boolean |
getReadOnly() |
boolean |
getRequired() |
boolean |
getSkip() |
int |
getValidationLayoutId() |
PropertyValidator |
getValidator() |
Object |
getValue()
Gets the value currently persisted on the source object.
|
Object |
getValueCandidate()
Gets the current value candidate that, in case of successful validation, will be persisted
on the source object's property.
|
Class<? extends EntityPropertyViewer> |
getViewerType() |
boolean |
isTypePrimitive() |
boolean |
isValid() |
String |
name()
Returns the name of the property.
|
void |
onPropertyChanged(String propertyName,
Object value) |
void |
onValidationResult(Object validatedValue,
boolean result,
String message) |
void |
onValidationStarted() |
void |
readMetadata(EntityPropertyMetadata metadata) |
void |
removeCommitListener(EntityPropertyCommitListener listener) |
void |
removeOnChangedListener(EntityPropertyChangedListener listener)
Use to remove the provided implementation of the
EntityPropertyChangedListener interface
from the collection of objects that listen for changes of the value of this property. |
void |
removeValidationCompletedListener(ValidationCompletedListener listener) |
void |
setColumnPosition(int value) |
void |
setColumnSpan(int value) |
void |
setConverter(PropertyConverter converter) |
void |
setCoreEditorLayoutId(int value) |
void |
setCustomMetadata(Object value) |
void |
setEditorLayoutId(int value) |
void |
setEditorParams(HashMap<String,Object> editorParams) |
void |
setEditorType(Class<EntityPropertyEditor> value) |
void |
setGroupName(String value) |
void |
setHeader(String value) |
void |
setHeaderLayoutId(int value) |
void |
setHintText(String value) |
void |
setImageResource(int value) |
void |
setPosition(int value) |
void |
setReadOnly(boolean value) |
void |
setRequired(boolean value) |
void |
setSkip(boolean value) |
void |
setValidationLayoutId(int value) |
void |
setValidator(PropertyValidator validator) |
void |
setValueCandidate(Object value)
Sets a value that, in case of successful validation, will be persisted on the source object's
property when
EntityProperty.commit() is called. |
void |
setViewerType(Class<EntityPropertyViewer> value) |
void |
tryCommit(Object value)
Tries to validate the provided value and if the validation succeeds, the value is committed.
|
Class |
type()
Gets the type of the property.
|
void |
updateValues(Object[] values) |
void |
validate(Object value) |
public EntityPropertyCore(String name, Class type, Entity owner)
EntityProperty
class with the provided arguments.name
- the name of the property.type
- the type of the propertyowner
- the owner Entity
to which the property belongs.public Object[] getEnumConstants()
getEnumConstants
in interface EntityProperty
public boolean isTypePrimitive()
isTypePrimitive
in interface EntityProperty
public void readMetadata(EntityPropertyMetadata metadata)
readMetadata
in interface EntityProperty
public void updateValues(Object[] values)
updateValues
in interface EntityProperty
public void setCustomMetadata(Object value)
setCustomMetadata
in interface EntityProperty
public Object getCustomMetadata()
getCustomMetadata
in interface EntityProperty
public void setReadOnly(boolean value)
setReadOnly
in interface EntityProperty
public boolean getReadOnly()
getReadOnly
in interface EntityProperty
public int getEditorLayoutId()
getEditorLayoutId
in interface EntityProperty
public void setEditorLayoutId(int value)
setEditorLayoutId
in interface EntityProperty
public int getCoreEditorLayoutId()
getCoreEditorLayoutId
in interface EntityProperty
public void setCoreEditorLayoutId(int value)
setCoreEditorLayoutId
in interface EntityProperty
public int getHeaderLayoutId()
getHeaderLayoutId
in interface EntityProperty
public void setHeaderLayoutId(int value)
setHeaderLayoutId
in interface EntityProperty
public int getValidationLayoutId()
getValidationLayoutId
in interface EntityProperty
public void setValidationLayoutId(int value)
setValidationLayoutId
in interface EntityProperty
public Class<? extends EntityPropertyViewer> getViewerType()
getViewerType
in interface EntityProperty
public void setViewerType(Class<EntityPropertyViewer> value)
setViewerType
in interface EntityProperty
public Class<? extends EntityPropertyEditor> getEditorType()
getEditorType
in interface EntityProperty
public void setEditorType(Class<EntityPropertyEditor> value)
setEditorType
in interface EntityProperty
public HashMap<String,Object> getEditorParams()
getEditorParams
in interface EntityProperty
public void setEditorParams(HashMap<String,Object> editorParams)
setEditorParams
in interface EntityProperty
public boolean getSkip()
getSkip
in interface EntityProperty
public void setSkip(boolean value)
setSkip
in interface EntityProperty
public void setColumnPosition(int value)
setColumnPosition
in interface EntityProperty
public int getColumnPosition()
getColumnPosition
in interface EntityProperty
public int getColumnSpan()
getColumnSpan
in interface EntityProperty
public void setColumnSpan(int value)
setColumnSpan
in interface EntityProperty
public int getPosition()
getPosition
in interface EntityProperty
public void setPosition(int value)
setPosition
in interface EntityProperty
public String getHeader()
getHeader
in interface EntityProperty
public void setHeader(String value)
setHeader
in interface EntityProperty
public int getImageResource()
getImageResource
in interface EntityProperty
public void setImageResource(int value)
setImageResource
in interface EntityProperty
public String getGroupName()
getGroupName
in interface EntityProperty
public void setGroupName(String value)
setGroupName
in interface EntityProperty
public String getHintText()
getHintText
in interface EntityProperty
public void setHintText(String value)
setHintText
in interface EntityProperty
public boolean getRequired()
getRequired
in interface EntityProperty
public void setRequired(boolean value)
setRequired
in interface EntityProperty
public void addOnChangedListener(EntityPropertyChangedListener listener)
EntityPropertyChangedListener
interface to the
collection of objects that listen for changes of the value of this property.addOnChangedListener
in interface EntityProperty
listener
- the event listener.public void removeOnChangedListener(EntityPropertyChangedListener listener)
EntityPropertyChangedListener
interface
from the collection of objects that listen for changes of the value of this property.removeOnChangedListener
in interface EntityProperty
listener
- the event listener to remove.public void addValidationCompletedListener(ValidationCompletedListener listener)
addValidationCompletedListener
in interface EntityProperty
public void removeValidationCompletedListener(ValidationCompletedListener listener)
removeValidationCompletedListener
in interface EntityProperty
public void addCommitListener(EntityPropertyCommitListener listener)
addCommitListener
in interface EntityProperty
public void removeCommitListener(EntityPropertyCommitListener listener)
removeCommitListener
in interface EntityProperty
public void tryCommit(Object value)
EntityProperty
tryCommit
in interface EntityProperty
public Class type()
type
in interface EntityProperty
Class
class representing the type.public String name()
name
in interface EntityProperty
public Object getValueCandidate()
getValueCandidate
in interface EntityProperty
public void setValueCandidate(Object value)
EntityProperty.commit()
is called.setValueCandidate
in interface EntityProperty
value
- the value candidate to set.public Entity getOwner()
getOwner
in interface EntityProperty
public Object getValue()
getValue
in interface EntityProperty
public void commit()
commit
in interface EntityProperty
public void setConverter(PropertyConverter converter)
setConverter
in interface EntityProperty
public PropertyConverter getConverter()
getConverter
in interface EntityProperty
public void setValidator(PropertyValidator validator)
setValidator
in interface EntityProperty
public PropertyValidator getValidator()
getValidator
in interface EntityProperty
public void validate(Object value)
validate
in interface EntityProperty
public void onValidationStarted()
public void onValidationResult(Object validatedValue, boolean result, String message)
public boolean isValid()
isValid
in interface EntityProperty
public void onPropertyChanged(String propertyName, Object value)
onPropertyChanged
in interface PropertyChangedListener