org.teiid.rhq.plugin.adapter.impl
Class PropertySimpleToEnumValueAdapter

java.lang.Object
  extended by org.teiid.rhq.plugin.adapter.api.AbstractPropertySimpleAdapter
      extended by org.teiid.rhq.plugin.adapter.impl.PropertySimpleToEnumValueAdapter
All Implemented Interfaces:
PropertyAdapter<org.rhq.core.domain.configuration.PropertySimple,org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple>

public class PropertySimpleToEnumValueAdapter
extends AbstractPropertySimpleAdapter
implements PropertyAdapter<org.rhq.core.domain.configuration.PropertySimple,org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple>

This class provides code that maps back and forth between a PropertySimple and an EnumValueSupport.


Constructor Summary
PropertySimpleToEnumValueAdapter()
           
 
Method Summary
 org.jboss.metatype.api.values.MetaValue convertToMetaValue(org.rhq.core.domain.configuration.PropertySimple propSimple, org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple propDefSimple, org.jboss.metatype.api.types.MetaType metaType)
          Given a Property and its PropertyDefinition, create and return a corresponding MetaValue with the specified MetaType.
 void populatePropertyFromMetaValue(org.rhq.core.domain.configuration.PropertySimple propSimple, org.jboss.metatype.api.values.MetaValue metaValue, org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple propDefSimple)
          Given a Property and its PropertyDefinition, as well as a MetaValue, populate the Property so it corresponds to the MetaValue.
protected  void setInnerValue(java.lang.String propSimpleValue, org.jboss.metatype.api.values.MetaValue metaValue, org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple propDefSimple)
           
 
Methods inherited from class org.teiid.rhq.plugin.adapter.api.AbstractPropertySimpleAdapter
convertToProperty, populateMetaValueFromProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.teiid.rhq.plugin.adapter.api.PropertyAdapter
convertToProperty, populateMetaValueFromProperty
 

Constructor Detail

PropertySimpleToEnumValueAdapter

public PropertySimpleToEnumValueAdapter()
Method Detail

populatePropertyFromMetaValue

public void populatePropertyFromMetaValue(org.rhq.core.domain.configuration.PropertySimple propSimple,
                                          org.jboss.metatype.api.values.MetaValue metaValue,
                                          org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple propDefSimple)
Description copied from interface: PropertyAdapter
Given a Property and its PropertyDefinition, as well as a MetaValue, populate the Property so it corresponds to the MetaValue. If the MetaValue is a from of list or map, all descendant MetaValue's should be added as descendants of the Property.

Specified by:
populatePropertyFromMetaValue in interface PropertyAdapter<org.rhq.core.domain.configuration.PropertySimple,org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple>
Parameters:
propSimple - the property to be populated; should not be null
metaValue - the MetaValue to be copied
propDefSimple - the property's definition

convertToMetaValue

public org.jboss.metatype.api.values.MetaValue convertToMetaValue(org.rhq.core.domain.configuration.PropertySimple propSimple,
                                                                  org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple propDefSimple,
                                                                  org.jboss.metatype.api.types.MetaType metaType)
Description copied from interface: PropertyAdapter
Given a Property and its PropertyDefinition, create and return a corresponding MetaValue with the specified MetaType. If the Property is a list or a map, all descendant Property's should be represented as descendants of the returned MetaValue. Generally this method can simply create an empty MetaValue object and then delegate the population of the guts of the object to PropertyAdapter.populateMetaValueFromProperty(Property, MetaValue, PropertyDefinition).

Specified by:
convertToMetaValue in interface PropertyAdapter<org.rhq.core.domain.configuration.PropertySimple,org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple>
Parameters:
propSimple - the property to be converted
propDefSimple - the property's definition
metaType - the type of MetaValue that should be created and returned
Returns:
the MetaValue representation of the given Property

setInnerValue

protected void setInnerValue(java.lang.String propSimpleValue,
                             org.jboss.metatype.api.values.MetaValue metaValue,
                             org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple propDefSimple)
Specified by:
setInnerValue in class AbstractPropertySimpleAdapter


Copyright © 2011. All Rights Reserved.