org.omg.DynamicAny

Interface DynAnyFactoryOperations

public interface DynAnyFactoryOperations

Defines the operations, applicable for DynAnyFactory. These operations produce new DynAny's either from Any, serving as a template and value provider, or from the given typecode.
Method Summary
DynAnycreate_dyn_any(Any value)
Create DynAny using the given Any as template.
DynAnycreate_dyn_any_from_type_code(TypeCode type)
Create DynAny for holding the data of the given type.

Method Detail

create_dyn_any

public DynAny create_dyn_any(Any value)
Create DynAny using the given Any as template.

Parameters: value the Any, providing type and value for the DynAny being created.

Returns: the created DynAny, having the same type and storing the same value as the passed Any.

Throws: InconsistentTypeCode if value.type().kind() is tk_Principal, tk_native or tk_abstract_interface. These types cannot be stored in DynAny.

create_dyn_any_from_type_code

public DynAny create_dyn_any_from_type_code(TypeCode type)
Create DynAny for holding the data of the given type. The returned DynAny is initialised to its agreed default value. The agreed default values are:
Type Value Creates
boolean false {@link DynAny}
numeric types, octet, fixed 0 {@link DynAny}
char, wchar (char) 0 {@link DynAny}
string, wstring empty string ("", not null) {@link DynAny}
{@link Any} {@link Any} with no value and typecode of kind {@link TCKind#tk_null} {@link DynAny}
Sequence Empty (zero size) sequence {@link DynSequence}
Array All members of array are recursively initialised to default values. {@link DynArray}
Structure, exception All fields of the structure (if any) are recursively initialised to default values. {@link DynStruct}
Enumeration Default value, indicated by typecode. {@link DynEnum}
Union Default variant (indicated by typecode), recursively initialised to its default value. {@link DynUnion}
Value, ValueBox null {@link DynValue}, {@link DynValueBox}
TypeCode Typecode of kind TCKind.tk_null {@link DynValue}, {@link DynValueBox}

Parameters: type the type of the data being stored.

Returns: the created DynAny, having the passed type.

Throws: InconsistentTypeCode if type.kind() is tk_Principal, tk_native or tk_abstract_interface. These types cannot be stored in DynAny.