JBoss Managed Parent POM 2.1.1.SP2

org.jboss.managed.api
Interface ManagedProperty

All Superinterfaces:
Serializable, TransientAttachments
All Known Implementing Classes:
ManagedPropertyImpl, WritethroughManagedPropertyImpl

public interface ManagedProperty
extends Serializable, TransientAttachments

A property associated with a ManagedDeployment, ManagedObject, or ManagedComponent. The property's name is a String and its value is a MetaValue. A property also has additional metadata associated with it, such as constraints on its value, a mandatory flag, a read-only flag, etc.

Version:
$Revision: 1.1 $
Author:
Adrian Brock, Scott.Stark@jboss.org

Method Summary
 String checkValidValue(MetaValue value)
          Check whether this is a valid value
 ManagedProperty copy()
          Create a copy of the managed property.
 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 NOTE: Clients should not use this method - it is intended for server-side use only.
 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<? extends MetaValue> getMaximumValue()
          Get the maximum value
 MetaType getMetaType()
          Get the type
 Comparable<? extends MetaValue> getMinimumValue()
          Get the minimum value
 String getName()
          Get the property's name
 ManagedObject getTargetManagedObject()
          Get the target ManagedObject.
 MetaValue getValue()
          Get the value
 boolean hasAnnotation(String key)
          Does the property have the annotation referenced by key.
 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 setField(String fieldName, Serializable value)
          Set a field
 void setManagedObject(ManagedObject managedObject)
          Set the managed object the property is associated with.
 void setModified(boolean flag)
          Set the modified state of the property value.
 void setRemoved(boolean flag)
          Set whether a property has been marked as removed from its ManagedObject.
 void setTargetManagedObject(ManagedObject target)
          Set the target ManagedObject.
 void setValue(MetaValue value)
          Set the value
 
Methods inherited from interface org.jboss.managed.api.TransientAttachments
getTransientAttachment, getTransientAttachment, setTransientAttachment
 

Method Detail

getManagedObject

ManagedObject getManagedObject()
Get the managed object the property is associated with. NOTE: Clients should not use this method - it is intended for server-side use only.

Returns:
the managed object

setManagedObject

void setManagedObject(ManagedObject managedObject)
Set the managed object the property is associated with. NOTE: Clients should not use this method - it is intended for server-side use only.

Parameters:
managedObject - the managed object

getTargetManagedObject

ManagedObject getTargetManagedObject()
Get the target ManagedObject. NOTE: Clients should not use this method - it is intended for server-side use only.

Returns:
the ManagedObject the property references, null if there is no reference or its unresolved.
See Also:
ManagementObjectRef}

setTargetManagedObject

void setTargetManagedObject(ManagedObject target)
Set the target ManagedObject. NOTE: Clients should not use this method - it is intended for server-side use only.

Parameters:
target - the target ManagedObject

getFields

Fields getFields()
Get the fields

Returns:
the fields

copy

ManagedProperty copy()
Create a copy of the managed property. This is a copy that whose fields are copies of the original property. Changes to the copies fields have not affect on the original.

Returns:
a copy of the managed property.

getField

<T> T getField(String fieldName,
               Class<T> expected)
Get a field

Type Parameters:
T - the expected type
Parameters:
fieldName - the field name
expected - the expected type
Returns:
the value

setField

void setField(String fieldName,
              Serializable value)
Set a field

Parameters:
fieldName - the field name
value - the value

getName

String getName()
Get the property's name

Returns:
the property's name

getMappedName

String getMappedName()
Get the property's mapped name. This is an optional name that allows for an external name to be mapped to an internal one.

Returns:
the mapped name if it exists, null if there is no mapped name.

getDescription

String getDescription()
Get the description

Returns:
the description

getMetaType

MetaType getMetaType()
Get the type

Returns:
the type

getAnnotations

Map<String,Annotation> getAnnotations()
Get the annotations associated with the property NOTE: Clients should not use this method - it is intended for server-side use only.

Returns:
the annotations associated with the property

hasAnnotation

boolean hasAnnotation(String key)
Does the property have the annotation referenced by key. NOTE: Clients should not use this method - it is intended for server-side use only.

Parameters:
key - the key into getAnnotations()
Returns:
true if the annotation exists, false otherwise.

hasViewUse

boolean hasViewUse(ViewUse use)
See if the property has the indicated ViewUse among its

Parameters:
use - - the ViewUse to check for
Returns:
true if the ViewUse exists in the property uses, false otherwise

getAdminViewUses

Collection<String> getAdminViewUses()
Return the admin view names associated with the property

Returns:
the potentially empty admin view names associated with the property

getActivationPolicy

ActivationPolicy getActivationPolicy()
Get the activation policy for property value updates.

Returns:
the property activation policy

getValue

MetaValue getValue()
Get the value

Returns:
the value

setValue

void setValue(MetaValue value)
Set the value

Parameters:
value - the value

getLegalValues

Set<MetaValue> getLegalValues()
Get the legal values

Returns:
the legal values

getDefaultValue

MetaValue getDefaultValue()
Get the property default value if one exists.

Returns:
the default value if one exists, null otherwise.

getMinimumValue

Comparable<? extends MetaValue> getMinimumValue()
Get the minimum value

Returns:
the minimum value, a MetaValue implementing Comparable

getMaximumValue

Comparable<? extends MetaValue> getMaximumValue()
Get the maximum value

Returns:
the maximum value, a MetaValue implementing Comparable

checkValidValue

String checkValidValue(MetaValue value)
Check whether this is a valid value

Parameters:
value - the value
Returns:
null for a valid value, an error message otherwise

isMandatory

boolean isMandatory()
Whether the property is mandatory

Returns:
true when mandatory

isReadOnly

boolean isReadOnly()
Whether the property is read only

Returns:
true when read only

isModified

boolean isModified()
Whether the property has been edited/modified.

Returns:
true when modified

setModified

void setModified(boolean flag)
Set the modified state of the property value.

Parameters:
flag - - whether the property has been modified

isRemoved

boolean isRemoved()
Whether the property has been marked as removed from its ManagedObject.

Returns:
true is the property has been removed.

setRemoved

void setRemoved(boolean flag)
Set whether a property has been marked as removed from its ManagedObject.

Parameters:
flag - - true is the property has been removed, false if not.

JBoss Managed Parent POM 2.1.1.SP2

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.