public class ManagedPropertyImpl extends Object implements ManagedProperty
Constructor and Description |
---|
ManagedPropertyImpl(Fields fields)
Create a new ManagedProperty that is not associated to
a ManagedObject.
|
ManagedPropertyImpl(ManagedObject managedObject,
Fields fields)
Create a new ManagedProperty.
|
ManagedPropertyImpl(String name)
Create a new ManagedProperty that is not associated to
a ManagedObject.
|
Modifier and Type | Method and Description |
---|---|
String |
checkValidValue(MetaValue value)
Check whether this is a valid value
|
ManagedProperty |
copy()
Create a copy of the managed property.
|
boolean |
equals(Object obj) |
ActivationPolicy |
getActivationPolicy()
Get the activation policy for property value updates.
|
Collection<String> |
getAdminViewUses()
Return the admin view names associated with the property
|
Map<String,Annotation> |
getAnnotations()
Get the annotations associated with the property
|
MetaValue |
getDefaultValue()
Get the property default value if one exists.
|
String |
getDescription()
Get the description
|
<T> T |
getField(String fieldName,
Class<T> expected)
Get a field
|
Fields |
getFields()
Get the fields
|
Set<MetaValue> |
getLegalValues()
Get the legal values
|
ManagedObject |
getManagedObject()
Get the managed object the property is associated with.
|
String |
getMappedName()
Get the property's mapped name.
|
Comparable<MetaValue> |
getMaximumValue()
Get the maximum value
|
MetaType |
getMetaType()
Get the type
|
Comparable<MetaValue> |
getMinimumValue()
Get the minimum value
|
String |
getName()
Get the property's name
|
ManagedObject |
getTargetManagedObject()
Get the target ManagedObject.
|
<T> T |
getTransientAttachment(Class<T> expectedType)
Get an attachment from the parameter,
uses the expected type as both the name
and to cast the resulting object.
|
Object |
getTransientAttachment(String name)
Get a transient attachment from the parameter.
|
MetaValue |
getValue()
Get the value
|
ViewUse[] |
getViewUse() |
boolean |
hasAnnotation(String key)
Does the property have the annotation referenced by key.
|
int |
hashCode() |
boolean |
hasViewUse(ViewUse use)
See if the property has the indicated ViewUse among its
|
boolean |
isMandatory()
Whether the property is mandatory
|
boolean |
isModified()
Whether the property has been edited/modified.
|
boolean |
isReadOnly()
Whether the property is read only
|
boolean |
isRemoved()
Whether the property has been marked as removed from its ManagedObject.
|
void |
setActivationPolicy(ActivationPolicy policy) |
void |
setAdminViewUses(Collection<String> viewUses) |
void |
setAnnotations(Map<String,Annotation> annotations) |
void |
setDescription(String description)
Set the description
|
void |
setField(String fieldName,
Serializable value)
Set a field
|
void |
setLegalValues(Set<MetaValue> values)
Set the legal values
|
void |
setManagedObject(ManagedObject managedObject)
Set managed object
|
void |
setMandatory(boolean flag)
Set whether the field is mandatory
|
void |
setMaximumValue(Comparable<MetaValue> value)
Set the maximum value
|
void |
setMetaType(MetaType type)
Set the meta type
|
void |
setMinimumValue(Comparable<MetaValue> value)
Set the minimum value
|
void |
setModified(boolean flag)
Set the modified state of the property value.
|
void |
setReadOnly(boolean flag) |
void |
setRemoved(boolean flag)
Set whether the property is removed
|
void |
setTargetManagedObject(ManagedObject target)
Set the target ManagedObject.
|
void |
setTransientAttachment(String name,
Object attachment)
Set an transient attachment against the parameter.
|
void |
setValue(MetaValue value)
Set the value
|
void |
setViewUse(ViewUse[] use) |
String |
toString() |
public ManagedPropertyImpl(String name)
name
- the managed property nameIllegalArgumentException
- for null fields or
missing Fields.NAMEpublic ManagedPropertyImpl(Fields fields)
fields
- the fieldsIllegalArgumentException
- for null fields or
missing Fields.NAMEpublic ManagedPropertyImpl(ManagedObject managedObject, Fields fields)
managedObject
- the managed object, may be nullfields
- the fieldsIllegalArgumentException
- for null fields or
missing Fields.NAMEpublic ManagedObject getManagedObject()
ManagedProperty
getManagedObject
in interface ManagedProperty
public void setManagedObject(ManagedObject managedObject)
setManagedObject
in interface ManagedProperty
managedObject
- the managed objectpublic ManagedObject getTargetManagedObject()
ManagedProperty
getTargetManagedObject
in interface ManagedProperty
ManagementObjectRef}
public void setTargetManagedObject(ManagedObject target)
ManagedProperty
setTargetManagedObject
in interface ManagedProperty
target
- the target ManagedObjectpublic Fields getFields()
ManagedProperty
getFields
in interface ManagedProperty
public <T> T getField(String fieldName, Class<T> expected)
ManagedProperty
getField
in interface ManagedProperty
T
- the expected typefieldName
- the field nameexpected
- the expected typepublic void setField(String fieldName, Serializable value)
ManagedProperty
setField
in interface ManagedProperty
fieldName
- the field namevalue
- the valuepublic String getName()
ManagedProperty
getName
in interface ManagedProperty
public String getMappedName()
ManagedProperty
getMappedName
in interface ManagedProperty
public String getDescription()
ManagedProperty
getDescription
in interface ManagedProperty
public void setDescription(String description)
description
- the descriptionpublic Map<String,Annotation> getAnnotations()
getAnnotations
in interface ManagedProperty
public void setAnnotations(Map<String,Annotation> annotations)
public boolean hasAnnotation(String key)
ManagedProperty
hasAnnotation
in interface ManagedProperty
key
- the key into ManagedProperty.getAnnotations()
public boolean hasViewUse(ViewUse use)
hasViewUse
in interface ManagedProperty
use
- - the ViewUse to check forpublic MetaType getMetaType()
ManagedProperty
getMetaType
in interface ManagedProperty
public void setMetaType(MetaType type)
type
- the meta typepublic MetaValue getValue()
ManagedProperty
getValue
in interface ManagedProperty
public void setValue(MetaValue value)
ManagedProperty
setValue
in interface ManagedProperty
value
- the valuepublic ViewUse[] getViewUse()
public void setViewUse(ViewUse[] use)
public Collection<String> getAdminViewUses()
ManagedProperty
getAdminViewUses
in interface ManagedProperty
public void setAdminViewUses(Collection<String> viewUses)
public ActivationPolicy getActivationPolicy()
ManagedProperty
getActivationPolicy
in interface ManagedProperty
public void setActivationPolicy(ActivationPolicy policy)
public Set<MetaValue> getLegalValues()
ManagedProperty
getLegalValues
in interface ManagedProperty
public void setLegalValues(Set<MetaValue> values)
values
- the valuespublic MetaValue getDefaultValue()
ManagedProperty
getDefaultValue
in interface ManagedProperty
public Comparable<MetaValue> getMinimumValue()
ManagedProperty
getMinimumValue
in interface ManagedProperty
public void setMinimumValue(Comparable<MetaValue> value)
value
- the valuepublic Comparable<MetaValue> getMaximumValue()
ManagedProperty
getMaximumValue
in interface ManagedProperty
public void setMaximumValue(Comparable<MetaValue> value)
value
- the valuepublic String checkValidValue(MetaValue value)
ManagedProperty
checkValidValue
in interface ManagedProperty
value
- the valuepublic boolean isMandatory()
ManagedProperty
isMandatory
in interface ManagedProperty
public boolean isReadOnly()
ManagedProperty
isReadOnly
in interface ManagedProperty
public void setReadOnly(boolean flag)
public boolean isModified()
ManagedProperty
isModified
in interface ManagedProperty
public void setModified(boolean flag)
ManagedProperty
setModified
in interface ManagedProperty
flag
- - whether the property has been modifiedpublic void setMandatory(boolean flag)
flag
- true for mandatorypublic boolean isRemoved()
ManagedProperty
isRemoved
in interface ManagedProperty
public void setRemoved(boolean flag)
setRemoved
in interface ManagedProperty
flag
- true for removedpublic <T> T getTransientAttachment(Class<T> expectedType)
TransientAttachments
getTransientAttachment
in interface TransientAttachments
T
- the expected typeexpectedType
- the expected typepublic Object getTransientAttachment(String name)
TransientAttachments
getTransientAttachment
in interface TransientAttachments
name
- the nameTransientAttachments.setTransientAttachment(String, Object)
public void setTransientAttachment(String name, Object attachment)
TransientAttachments
setTransientAttachment
in interface TransientAttachments
name
- the nameattachment
- the attachment, pass null to remove an attachmentpublic ManagedProperty copy()
ManagedProperty
copy
in interface ManagedProperty
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.