Apama API Reference for .NET  10.7.2.0
Apama.Event.Parser.FieldType< T > Class Template Referenceabstract

Represents an Apama type. Used to define the type of fields in an EventType, and also for type parameters in complex types such as FieldTypes.Sequence<T>(FieldType<T>). Get field type objects using FieldTypes. More...

Inherits FieldType.

Inherited by Apama.Event.Parser.ContextFieldType, Apama.Event.Parser.DictionaryFieldType< TKey, TValue >, Apama.Event.Parser.OptionalFieldType< OptionalT, BaseT >, Apama.Event.Parser.PrimitiveFieldType< T >, Apama.Event.Parser.ReferenceFieldType< T >, Apama.Event.Parser.SequenceFieldType< E >, Apama.Event.Parser.DictionaryFieldType< Object, Object >, and Apama.Event.Parser.SequenceFieldType< Object >.

Public Member Functions

abstract T DefaultValue ()
 Returns default value of this field type. It is used when returning value of a field not explicitly set. More...
 
virtual string Format (Object value)
 Format the given value in MonitorScript representation. More...
 
abstract object GetDefaultValue ()
 Get the default value for this field type. More...
 
Field< T > NewField (string name)
 Creates a new Field object with the specified name, using this field type. More...
 
abstract T Parse (String value)
 Parse a token according to syntax rules of this type. More...
 
abstract object ParseObject (String value)
 Parse a value from this type's Apama event string representation into the .NET object representation of the value. More...
 
override string ToString ()
 For Internal use only More...
 

Protected Member Functions

 FieldType (string typeName, Type clazz)
 Create a new FieldType. More...
 

Properties

virtual string Name [get]
 Return the name of this type. More...
 
Type TypeClass [get]
 Return the .NET type used to express values of this Apama field type. More...
 

Detailed Description

Represents an Apama type. Used to define the type of fields in an EventType, and also for type parameters in complex types such as FieldTypes.Sequence<T>(FieldType<T>). Get field type objects using FieldTypes.

Non-generic abstract base class representing an Apama type (with reduced compile-time type safety).

Almost all new applications should use this class instead of the legacy non-generic FieldType class.

To get FieldType objects, use FieldTypes.

The following example shows how it is possible to create a field object whose type is an Apama sequence of integers:

var myField = FieldTypes.Sequence(FieldTypes.Integer).NewField("myField");
Template Parameters
TThe .NET type used to represent values of this field type.

For most applications, it is better to use the generic FieldType<T> class instead of this one, unless there is a specific requirement to process fields from Event objects without access to the corresponding generic FieldType<T> object.

Constructor & Destructor Documentation

◆ FieldType()

Apama.Event.Parser.FieldType< T >.FieldType ( string  typeName,
Type  clazz 
)
protected

Create a new FieldType.

Parameters
typeNamethe name of the fieldtype
clazzthe underlying type of the fieldtype

Member Function Documentation

◆ DefaultValue()

◆ Format()

virtual string Apama.Event.Parser.FieldType< T >.Format ( Object  value)
virtual

Format the given value in MonitorScript representation.

Parameters
valueThe value to format
Returns
The formatted value

Reimplemented in Apama.Event.Parser.DictionaryFieldType< TKey, TValue >, Apama.Event.Parser.DictionaryFieldType< Object, Object >, Apama.Event.Parser.SequenceFieldType< E >, and Apama.Event.Parser.SequenceFieldType< Object >.

◆ GetDefaultValue()

abstract object Apama.Event.Parser.FieldType< T >.GetDefaultValue ( )
pure virtual

Get the default value for this field type.

Returns

◆ NewField()

Field<T> Apama.Event.Parser.FieldType< T >.NewField ( string  name)

Creates a new Field object with the specified name, using this field type.

This is exactly the same as calling the Field constructor, but involves less typing because the generic type parameter can be inferred automatically

Parameters
name
Returns

◆ Parse()

abstract T Apama.Event.Parser.FieldType< T >.Parse ( String  value)
pure virtual

Parse a token according to syntax rules of this type.

Parameters
valueThe value to parse
Returns
An object of the correct type

Implemented in Apama.Event.Parser.AnyFieldType.

◆ ParseObject()

abstract object Apama.Event.Parser.FieldType< T >.ParseObject ( String  value)
pure virtual

Parse a value from this type's Apama event string representation into the .NET object representation of the value.

Usually it is better to use the Parse method instead of ParseObject, since Parse indicates the return type in its method signature, providing better usability and type safety than ParseObject.

Parameters
valueThe value to parse
Returns
A .NET object representing the parsed value.

◆ ToString()

override string Apama.Event.Parser.FieldType< T >.ToString ( )

For Internal use only

Property Documentation

◆ Name

virtual string Apama.Event.Parser.FieldType< T >.Name
get

Return the name of this type.

Returns
The type name

◆ TypeClass

Type Apama.Event.Parser.FieldType< T >.TypeClass
get

Return the .NET type used to express values of this Apama field type.

Returns
The class representation of the field
Submit a bug or feature
Copyright (c) 2013-2021 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.