gr.uoa.di.madgik.execution.datatype
Class DataTypeReflectable

java.lang.Object
  extended by gr.uoa.di.madgik.execution.datatype.DataTypeReflectable
All Implemented Interfaces:
IDataType, Serializable, Iterable<ReflectableItem>

public class DataTypeReflectable
extends Object
implements IDataType, Iterable<ReflectableItem>

This class represents data type with a collection of ReflectableItem payload

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface gr.uoa.di.madgik.execution.datatype.IDataType
IDataType.DataTypes
 
Constructor Summary
DataTypeReflectable()
           
 
Method Summary
 boolean CanSuggestDataTypeClass()
          Always returns false
 void FromXML(Element XML)
          Parses the xml serialization of the data type as retrieved by IDataType.ToXML()
 void FromXML(String XML)
          Parses the xml serialization of the data type as retrieved by IDataType.ToXML()
 Class<?> GetDataTypeClass()
          Returns null
 IDataType.DataTypes GetDataTypeEnum()
          Returns IDataType.DataTypes.Reflectable
 ReflectableItem[] GetItems()
          Retrieves the ReflectableItems that make up this instance
 String GetStringValue()
          Returns ToXML()
 Object GetValue()
          Returns this instance
 Iterator<ReflectableItem> iterator()
           
 void SetStringValue(String val)
          Calls DataTypeReflectable#FromXML(String))
 void SetValue(Object Value)
          If the provided value is null, the collection of ReflectableItem is also set to null.
 String ToXML()
          Creates an xml serialization of the data type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeReflectable

public DataTypeReflectable()
Method Detail

iterator

public Iterator<ReflectableItem> iterator()
Specified by:
iterator in interface Iterable<ReflectableItem>

CanSuggestDataTypeClass

public boolean CanSuggestDataTypeClass()
Always returns false

Specified by:
CanSuggestDataTypeClass in interface IDataType
Returns:
true, if it can
See Also:
IDataType.CanSuggestDataTypeClass()

GetDataTypeClass

public Class<?> GetDataTypeClass()
Returns null

Specified by:
GetDataTypeClass in interface IDataType
Returns:
the run time type
See Also:
IDataType.GetDataTypeClass()

GetDataTypeEnum

public IDataType.DataTypes GetDataTypeEnum()
Returns IDataType.DataTypes.Reflectable

Specified by:
GetDataTypeEnum in interface IDataType
Returns:
the data type
See Also:
IDataType.GetDataTypeEnum()

GetStringValue

public String GetStringValue()
                      throws ExecutionSerializationException
Returns ToXML()

Specified by:
GetStringValue in interface IDataType
Returns:
the string representation of the value
Throws:
ExecutionSerializationException - A serialization error occurred
See Also:
IDataType.GetStringValue()

SetStringValue

public void SetStringValue(String val)
                    throws ExecutionValidationException,
                           ExecutionSerializationException
Calls DataTypeReflectable#FromXML(String))

Specified by:
SetStringValue in interface IDataType
Parameters:
val - the value to set
Throws:
ExecutionValidationException - A validation error occurred
ExecutionSerializationException - A serialization error occurred
See Also:
IDataType.SetStringValue(java.lang.String)

GetValue

public Object GetValue()
Returns this instance

Specified by:
GetValue in interface IDataType
Returns:
the value
See Also:
IDataType.GetValue()

GetItems

public ReflectableItem[] GetItems()
Retrieves the ReflectableItems that make up this instance

Returns:
the reflectable item collection

SetValue

public void SetValue(Object Value)
              throws ExecutionValidationException
If the provided value is null, the collection of ReflectableItem is also set to null. Otherwise, if the provided value is an array of ReflectableItem, the internal collection is set to the provided array. If the provided value is a DataTypeReflectable, the internal collection is set to the internal collection of the provided DataTypeReflectable. Otherwise, if the provided value is a string, the DataTypeReflectable#FromXML(String)) is called. Otherwise, an instance of a ReflectableAnalyzer is created, and the produced DataTypeReflectable retrieved by ReflectableAnalyzer.ProduceReflectable(Object) is used.

Specified by:
SetValue in interface IDataType
Parameters:
Value - the value to set
Throws:
ExecutionValidationException - A validation error occurred
See Also:
IDataType.SetValue(java.lang.Object)

FromXML

public void FromXML(String XML)
             throws ExecutionSerializationException
Description copied from interface: IDataType
Parses the xml serialization of the data type as retrieved by IDataType.ToXML()

Specified by:
FromXML in interface IDataType
Parameters:
XML - the XML serialization
Throws:
ExecutionSerializationException - A serialization error occurred

FromXML

public void FromXML(Element XML)
             throws ExecutionSerializationException
Description copied from interface: IDataType
Parses the xml serialization of the data type as retrieved by IDataType.ToXML()

Specified by:
FromXML in interface IDataType
Parameters:
XML - The root element of the serialization
Throws:
ExecutionSerializationException - A validation error occurred

ToXML

public String ToXML()
             throws ExecutionSerializationException
Description copied from interface: IDataType
Creates an xml serialization of the data type

Specified by:
ToXML in interface IDataType
Returns:
the XML serialization
Throws:
ExecutionSerializationException - a serialization error occurred


Copyright © 2013. All Rights Reserved.