org.jboss.managed.plugins
Class ManagedPropertyImpl

java.lang.Object
  extended by org.jboss.managed.plugins.ManagedPropertyImpl
All Implemented Interfaces:
Serializable, ManagedProperty
Direct Known Subclasses:
WritethroughManagedPropertyImpl

public class ManagedPropertyImpl
extends Object
implements ManagedProperty

ManagedProperty.

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
Serialized Form

Constructor Summary
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.
 
Method Summary
 String checkValidValue(Serializable value)
          Check whether this is a valid value
 boolean equals(Object obj)
           
 Map<String,Annotation> getAnnotations()
          Get the annotations associated with the property
 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<?> getMaximumValue()
          Get the miximum value
 MetaType getMetaType()
          Get the type
 Comparable<?> getMinimumValue()
          Get the minimum value
 String getName()
          Get the property's name
 ManagedObject getTargetManagedObject()
          Get the ManagedObject
 Object getValue()
          Get the value
 int hashCode()
           
 boolean hasViewUse(ViewUse use)
          See if the property has the indicated ViewUse among its
 boolean isMandatory()
          Whether the property is mandatory
 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<?> value)
          Set the maximum value
 void setMetaType(MetaType type)
          Set the meta type
 void setMinimumValue(Comparable<?> value)
          Set the minimum value
 void setTargetManagedObject(ManagedObject target)
           
 void setValue(Serializable value)
          Set the value
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManagedPropertyImpl

public ManagedPropertyImpl(String name)
Create a new ManagedProperty that is not associated to a ManagedObject.

Parameters:
name - the managed property name
Throws:
IllegalArgumentException - for null fields or missing Fields.NAME

ManagedPropertyImpl

public ManagedPropertyImpl(Fields fields)
Create a new ManagedProperty that is not associated to a ManagedObject.

Parameters:
fields - the fields
Throws:
IllegalArgumentException - for null fields or missing Fields.NAME

ManagedPropertyImpl

public ManagedPropertyImpl(ManagedObject managedObject,
                           Fields fields)
Create a new ManagedProperty.

Parameters:
managedObject - the managed object, may be null
fields - the fields
Throws:
IllegalArgumentException - for null fields or missing Fields.NAME
Method Detail

getManagedObject

public ManagedObject getManagedObject()
Description copied from interface: ManagedProperty
Get the managed object the property is associated with.

Specified by:
getManagedObject in interface ManagedProperty
Returns:
the managed object

setManagedObject

public void setManagedObject(ManagedObject managedObject)
Set managed object

Specified by:
setManagedObject in interface ManagedProperty
Parameters:
managedObject - the managed object

getTargetManagedObject

public ManagedObject getTargetManagedObject()
Description copied from interface: ManagedProperty
Get the ManagedObject

Specified by:
getTargetManagedObject in interface ManagedProperty
Returns:
the ManagedObject the property references, null if there is no reference or its unresolved.
See Also:
ManagementObjectRef}

setTargetManagedObject

public void setTargetManagedObject(ManagedObject target)
Specified by:
setTargetManagedObject in interface ManagedProperty

getFields

public Fields getFields()
Description copied from interface: ManagedProperty
Get the fields

Specified by:
getFields in interface ManagedProperty
Returns:
the fields

getField

public <T> T getField(String fieldName,
                      Class<T> expected)
Description copied from interface: ManagedProperty
Get a field

Specified by:
getField in interface ManagedProperty
Type Parameters:
T - the expected type
Parameters:
fieldName - the field name
expected - the expected type
Returns:
the value

setField

public void setField(String fieldName,
                     Serializable value)
Description copied from interface: ManagedProperty
Set a field

Specified by:
setField in interface ManagedProperty
Parameters:
fieldName - the field name
value - the value

getName

public String getName()
Description copied from interface: ManagedProperty
Get the property's name

Specified by:
getName in interface ManagedProperty
Returns:
the property's name

getMappedName

public String getMappedName()
Description copied from interface: ManagedProperty
Get the property's mapped name. This is an optional name that allows for an external name to be mapped to an internal one.

Specified by:
getMappedName in interface ManagedProperty
Returns:
the mapped name if it exists, null if there is no mapped name.

getDescription

public String getDescription()
Description copied from interface: ManagedProperty
Get the description

Specified by:
getDescription in interface ManagedProperty
Returns:
the description

setDescription

public void setDescription(String description)
Set the description

Parameters:
description - the description

getAnnotations

public Map<String,Annotation> getAnnotations()
Get the annotations associated with the property

Specified by:
getAnnotations in interface ManagedProperty
Returns:
the annotations associated with the property

setAnnotations

public void setAnnotations(Map<String,Annotation> annotations)

hasViewUse

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

Specified by:
hasViewUse in interface ManagedProperty
Parameters:
use - - the ViewUse to check for
Returns:
true if the ViewUse exists in the property uses, false otherwise

getMetaType

public MetaType getMetaType()
Description copied from interface: ManagedProperty
Get the type

Specified by:
getMetaType in interface ManagedProperty
Returns:
the type

setMetaType

public void setMetaType(MetaType type)
Set the meta type

Parameters:
type - the meta type

getValue

public Object getValue()
Description copied from interface: ManagedProperty
Get the value

Specified by:
getValue in interface ManagedProperty
Returns:
the value

setValue

public void setValue(Serializable value)
Description copied from interface: ManagedProperty
Set the value

Specified by:
setValue in interface ManagedProperty
Parameters:
value - the value

getLegalValues

public Set<MetaValue> getLegalValues()
Description copied from interface: ManagedProperty
Get the legal values

Specified by:
getLegalValues in interface ManagedProperty
Returns:
the legal values

setLegalValues

public void setLegalValues(Set<MetaValue> values)
Set the legal values

Parameters:
values - the values

getMinimumValue

public Comparable<?> getMinimumValue()
Description copied from interface: ManagedProperty
Get the minimum value

Specified by:
getMinimumValue in interface ManagedProperty
Returns:
the minimum value

setMinimumValue

public void setMinimumValue(Comparable<?> value)
Set the minimum value

Parameters:
value - the value

getMaximumValue

public Comparable<?> getMaximumValue()
Description copied from interface: ManagedProperty
Get the miximum value

Specified by:
getMaximumValue in interface ManagedProperty
Returns:
the maximum value

setMaximumValue

public void setMaximumValue(Comparable<?> value)
Set the maximum value

Parameters:
value - the value

checkValidValue

public String checkValidValue(Serializable value)
Description copied from interface: ManagedProperty
Check whether this is a valid value

Specified by:
checkValidValue in interface ManagedProperty
Parameters:
value - the value
Returns:
null for a valid value, an error message otherwise

isMandatory

public boolean isMandatory()
Description copied from interface: ManagedProperty
Whether the property is mandatory

Specified by:
isMandatory in interface ManagedProperty
Returns:
true when mandatory

setMandatory

public void setMandatory(boolean flag)
Set whether the field is mandatory

Parameters:
flag - true for mandatory

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2008 JBoss Inc.. All Rights Reserved.