com.apama.event.parser
Class FieldType<T>

java.lang.Object
  extended by com.apama.event.parser.FieldType<T>
Type Parameters:
T - The Java type used for field values of this type.
Direct Known Subclasses:
BooleanFieldType, DecimalFieldType, DictionaryFieldType, EventType, FloatFieldType, IntegerFieldType, LocationFieldType, SequenceFieldType, StringFieldType

public abstract class FieldType<T>
extends java.lang.Object

Represents an Apama type. Used to define the type of fields in an EventType, and also for type parameters in complex types such as DictionaryFieldType. Get field type objects using FieldTypes.


Method Summary
abstract  void assertAssignable(java.lang.Object c, java.lang.String fieldName)
          This method is intended for internal use only and may be removed at any time - do not use.
 java.lang.String format(java.lang.Object value)
          Format the given value in MonitorScript representation.
 java.lang.String getName()
          Return the name of this type.
 java.lang.Class<? super T> getTypeClass()
          Return the Java type used for parsed values of this field type.
 Field<T> newField(java.lang.String name)
          Creates a new Field object with the specified name, using this field type.
 T parse(java.lang.String value)
          Parse an Apama string representation of this field type into an object representing its value.
 java.lang.String toString()
          Returns a String representation of the field type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

newField

public Field<T> newField(java.lang.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 Java will automatically infer the generic type parameters.

Parameters:
name - The field name
Returns:
A new Field object

getName

public java.lang.String getName()
Return the name of this type.

Returns:
the type name

getTypeClass

public java.lang.Class<? super T> getTypeClass()
Return the Java type used for parsed values of this field type.

Returns:
the the Java type used for parsed values of this field type.

format

public java.lang.String format(java.lang.Object value)
Format the given value in MonitorScript representation.

Parameters:
value - the value to format
Returns:
the formatted value

parse

public T parse(java.lang.String value)
        throws ParserRuntimeException
Parse an Apama string representation of this field type into an object representing its value.

Parameters:
value - the value to parse
Returns:
an object specifying the value, the type of which depends on which class this method is called on.
Throws:
ParserRuntimeException - if some problem occurs

assertAssignable

public abstract void assertAssignable(java.lang.Object c,
                                      java.lang.String fieldName)
This method is intended for internal use only and may be removed at any time - do not use.


toString

public java.lang.String toString()
Returns a String representation of the field type. Note that this representation will use the Java toString() method to format the results, and is not valid monitorscript.

Overrides:
toString in class java.lang.Object


Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG