org.jboss.system.server.profileservice.persistence
Class AbstractValueRecreation

java.lang.Object
  extended by org.jboss.system.server.profileservice.persistence.AbstractValueRecreation

public class AbstractValueRecreation
extends Object

The abstract value recreation creates MetaValues based on the persisted managed object information and the MetaTypes of the ManagedObject used for persistence. The recreation of ManagedObjects itself is delegated to a ManagedObjectRecreationPlugin.

Version:
$Revision$
Author:
Emanuel Muckenhuber

Constructor Summary
AbstractValueRecreation(ManagedObjectPersistencePlugin callback)
           
 
Method Summary
 Serializable convert2Type(String className, String value)
          Convert simple types.
protected  org.jboss.metatype.api.values.ArrayValue createArrayValue(PersistedArrayValue valueElement, org.jboss.metatype.api.types.ArrayMetaType type)
          Create array value.
protected  org.jboss.metatype.api.values.CollectionValue createCollectionValue(PersistedCollectionValue collection, org.jboss.metatype.api.types.CollectionMetaType type)
          Process a collection.
protected  org.jboss.metatype.api.values.CompositeValue createCompositeValue(PersistedCompositeValue composite, org.jboss.metatype.api.types.CompositeMetaType type)
          Create composite value.
protected  org.jboss.metatype.api.values.EnumValue createEnumValue(PersistedEnumValue enumElement, org.jboss.metatype.api.types.EnumMetaType type)
          Process an Enum value.
protected  org.jboss.metatype.api.values.GenericValue createGenericValue(PersistedGenericValue genericElement, org.jboss.metatype.api.types.GenericMetaType metaType)
          Create generic value.
 org.jboss.metatype.api.values.MetaValue createMetaValue(PersistedValue valueElement, org.jboss.metatype.api.types.MetaType metaType)
          Create the meta value, based on the xml persisted value and the generated MetaType.
protected  org.jboss.metatype.api.values.MetaValue createPropertiesValue(PersistedPropertiesValue value, org.jboss.metatype.api.types.PropertiesMetaType metaType)
          Create the properties value.
protected  org.jboss.metatype.api.values.SimpleValue createSimpleValue(PersistedSimpleValue valueElement, org.jboss.metatype.api.types.SimpleMetaType metaType)
          Create simple value.
protected  org.jboss.metatype.api.values.TableValue createTableValue(PersistedTableValue table, org.jboss.metatype.api.types.TableMetaType type)
          Create the table value.
 ManagedObjectPersistencePlugin getPlugin()
           
protected  org.jboss.metatype.api.values.MapCompositeValueSupport handleMapCompositeMetaType(PersistedCompositeValue composite, org.jboss.metatype.api.types.MapCompositeMetaType type)
          Create the MapCompositeValueSupport value.
protected  Object recreateArrayValue(PersistedArrayValue valueElement, org.jboss.metatype.api.types.MetaType type)
          Recreate the array values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractValueRecreation

public AbstractValueRecreation(ManagedObjectPersistencePlugin callback)
Method Detail

getPlugin

public ManagedObjectPersistencePlugin getPlugin()

createMetaValue

public org.jboss.metatype.api.values.MetaValue createMetaValue(PersistedValue valueElement,
                                                               org.jboss.metatype.api.types.MetaType metaType)
Create the meta value, based on the xml persisted value and the generated MetaType.

Parameters:
valueElement - the persisted xml element
type - the meta type
Returns:
the created meta value

createSimpleValue

protected org.jboss.metatype.api.values.SimpleValue createSimpleValue(PersistedSimpleValue valueElement,
                                                                      org.jboss.metatype.api.types.SimpleMetaType metaType)
Create simple value.

Parameters:
valueElement - the persisted xml meta data
value - the simple value
Returns:
a simple value

createEnumValue

protected org.jboss.metatype.api.values.EnumValue createEnumValue(PersistedEnumValue enumElement,
                                                                  org.jboss.metatype.api.types.EnumMetaType type)
Process an Enum value.

Parameters:
enumElement - the persisted xml meta data
value - the enum value
Returns:
a enum value

createCompositeValue

protected org.jboss.metatype.api.values.CompositeValue createCompositeValue(PersistedCompositeValue composite,
                                                                            org.jboss.metatype.api.types.CompositeMetaType type)
Create composite value.

Parameters:
composite - the persisted xml meta data
value - the composite value
Returns:
a composite value

handleMapCompositeMetaType

protected org.jboss.metatype.api.values.MapCompositeValueSupport handleMapCompositeMetaType(PersistedCompositeValue composite,
                                                                                            org.jboss.metatype.api.types.MapCompositeMetaType type)
Create the MapCompositeValueSupport value.

Parameters:
composite - the persisted composite xml meta data
type - the MapComposite meta type
Returns:
the MapCompositeValueSupport

createCollectionValue

protected org.jboss.metatype.api.values.CollectionValue createCollectionValue(PersistedCollectionValue collection,
                                                                              org.jboss.metatype.api.types.CollectionMetaType type)
Process a collection.

Parameters:
collection - the persisted xml meta data
value - the collection value
Returns:
a collection value

createGenericValue

protected org.jboss.metatype.api.values.GenericValue createGenericValue(PersistedGenericValue genericElement,
                                                                        org.jboss.metatype.api.types.GenericMetaType metaType)
Create generic value.

Parameters:
genericElement - the persisted generic xml meta data
metaType - the generic meta type
Returns:
the generic value

createTableValue

protected org.jboss.metatype.api.values.TableValue createTableValue(PersistedTableValue table,
                                                                    org.jboss.metatype.api.types.TableMetaType type)
Create the table value.

Parameters:
table - the persisted table value
type - the table meta type
Returns:
the table value

createPropertiesValue

protected org.jboss.metatype.api.values.MetaValue createPropertiesValue(PersistedPropertiesValue value,
                                                                        org.jboss.metatype.api.types.PropertiesMetaType metaType)
Create the properties value.

Parameters:
value - the persisted properties value
metaType - the properties meta type
Returns:
the properties value

createArrayValue

protected org.jboss.metatype.api.values.ArrayValue createArrayValue(PersistedArrayValue valueElement,
                                                                    org.jboss.metatype.api.types.ArrayMetaType type)
Create array value.

Parameters:
valueElement - the persisted array xml value
type - the array meta type
Returns:
the array value

recreateArrayValue

protected Object recreateArrayValue(PersistedArrayValue valueElement,
                                    org.jboss.metatype.api.types.MetaType type)
Recreate the array values.

Parameters:
valueElement - the persisted xml value
type - the element type
Returns:
the recreated array

convert2Type

public Serializable convert2Type(String className,
                                 String value)
Convert simple types.

Parameters:
clazz - a primitive serializable class.
value - the String
Returns:
the converted object, null in case of any failure.


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