org.jboss.managed.plugins
Class ManagedParameterImpl

java.lang.Object
  extended by org.jboss.managed.plugins.ManagedParameterImpl
All Implemented Interfaces:
Serializable, ManagedParameter, TransientAttachments

public class ManagedParameterImpl
extends Object
implements ManagedParameter

Version:
$Revision: 87004 $
Author:
Scott.Stark@jboss.org
See Also:
Serialized Form

Constructor Summary
ManagedParameterImpl(Fields fields)
          Create a new ManagedProperty that is not associated to a ManagedObject.
ManagedParameterImpl(String name)
          Create a new ManagedProperty that is not associated to a ManagedObject.
 
Method Summary
 String checkValidValue(MetaValue 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
 Comparable<?> getMaximumValue()
          Get the miximum value
 MetaType getMetaType()
          Get the type
 Comparable<?> getMinimumValue()
          Get the minimum value
 String getName()
          Get the property's name
<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
 int hashCode()
           
 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 setMaximumValue(Comparable<?> value)
          Set the maximum value
 void setMetaType(MetaType type)
          Set the meta type
 void setMinimumValue(Comparable<?> value)
          Set the minimum value
 void setTransientAttachment(String name, Object attachment)
          Set an transient attachment against the parameter.
 void setValue(MetaValue value)
          Set the value
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManagedParameterImpl

public ManagedParameterImpl(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

ManagedParameterImpl

public ManagedParameterImpl(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
Method Detail

getFields

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

Specified by:
getFields in interface ManagedParameter
Returns:
the fields

getField

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

Specified by:
getField in interface ManagedParameter
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: ManagedParameter
Set a field

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

getName

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

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

getDescription

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

Specified by:
getDescription in interface ManagedParameter
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

Returns:
the annotations associated with the property

setAnnotations

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

getMetaType

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

Specified by:
getMetaType in interface ManagedParameter
Returns:
the type

setMetaType

public void setMetaType(MetaType type)
Set the meta type

Parameters:
type - the meta type

getValue

public MetaValue getValue()
Description copied from interface: ManagedParameter
Get the value

Specified by:
getValue in interface ManagedParameter
Returns:
the value

setValue

public void setValue(MetaValue value)
Description copied from interface: ManagedParameter
Set the value

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

getLegalValues

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

Specified by:
getLegalValues in interface ManagedParameter
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: ManagedParameter
Get the minimum value

Specified by:
getMinimumValue in interface ManagedParameter
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: ManagedParameter
Get the miximum value

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

setMaximumValue

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

Parameters:
value - the value

checkValidValue

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

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

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

getTransientAttachment

public <T> T getTransientAttachment(Class<T> expectedType)
Description copied from interface: TransientAttachments
Get an attachment from the parameter, uses the expected type as both the name and to cast the resulting object.

Specified by:
getTransientAttachment in interface TransientAttachments
Type Parameters:
T - the expected type
Parameters:
expectedType - the expected type
Returns:
the attachment

getTransientAttachment

public Object getTransientAttachment(String name)
Description copied from interface: TransientAttachments
Get a transient attachment from the parameter.

Specified by:
getTransientAttachment in interface TransientAttachments
Parameters:
name - the name
Returns:
the attachment
See Also:
TransientAttachments.setTransientAttachment(String, Object)

setTransientAttachment

public void setTransientAttachment(String name,
                                   Object attachment)
Description copied from interface: TransientAttachments
Set an transient attachment against the parameter. A transient attachment is one that will not be available to clients of the parameter, typically admin tools. Such attachments are used by the server side where the underlying metadata to which the parameter is associated is available.

Specified by:
setTransientAttachment in interface TransientAttachments
Parameters:
name - the name
attachment - the attachment, pass null to remove an attachment


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