org.openfast.template
Class MessageTemplate

java.lang.Object
  extended by org.openfast.template.Field
      extended by org.openfast.template.Group
          extended by org.openfast.template.MessageTemplate
All Implemented Interfaces:
java.io.Serializable, FieldSet

public class MessageTemplate
extends Group
implements FieldSet

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.openfast.template.Group
childNamespace, fieldDefinitions, fieldIdMap, fieldIndexMap, fieldNameMap, fields, introspectiveFieldMap, staticTemplateReferences, usesPresenceMap
 
Fields inherited from class org.openfast.template.Field
id, key, name, optional
 
Constructor Summary
MessageTemplate(QName name, Field[] fields)
           
MessageTemplate(java.lang.String name, Field[] fields)
           
 
Method Summary
 FieldValue createValue(java.lang.String value)
          createValue method declaration
 Message decode(java.io.InputStream in, int templateId, BitVectorReader presenceMapReader, Context context)
          Decodes the inputStream and creates a new message that contains this information
 byte[] encode(Message message, Context context)
          Uses the superclasses encode method to encode the byte array - see Group.java
 boolean equals(java.lang.Object obj)
           
 Field getField(int index)
          Find the field object of the index passed
 int getFieldCount()
          Find the number of total fields
 Field[] getFields()
           
 Field[] getTemplateFields()
          Returns a field array of the current stored fields
 java.lang.Class getValueType()
          getValueType method declaration
 int hashCode()
           
 java.lang.String toString()
           
 boolean usesPresenceMap()
           
 
Methods inherited from class org.openfast.template.Group
decode, decodeFieldValues, decodeFieldValues, encode, encode, getChildNamespace, getField, getField, getFieldById, getFieldDefinitions, getFieldIndex, getFieldIndex, getGroup, getIntrospectiveField, getScalar, getScalar, getSequence, getStaticTemplateReference, getStaticTemplateReference, getStaticTemplateReferences, getTypeName, getTypeReference, hasField, hasField, hasFieldWithId, hasIntrospectiveField, hasTypeReference, isPresenceMapBitSet, setChildNamespace, setTypeReference, usesPresenceMapBit
 
Methods inherited from class org.openfast.template.Field
addAttribute, getAttribute, getId, getKey, getName, getQName, hasAttribute, isOptional, isPresent, setId, setKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageTemplate

public MessageTemplate(QName name,
                       Field[] fields)

MessageTemplate

public MessageTemplate(java.lang.String name,
                       Field[] fields)
Method Detail

usesPresenceMap

public boolean usesPresenceMap()
Overrides:
usesPresenceMap in class Group

getField

public Field getField(int index)
Description copied from class: Group
Find the field object of the index passed

Specified by:
getField in interface FieldSet
Overrides:
getField in class Group
Parameters:
index - The index to find the field
Returns:
Returns the index of the field object

getFieldCount

public int getFieldCount()
Description copied from class: Group
Find the number of total fields

Specified by:
getFieldCount in interface FieldSet
Overrides:
getFieldCount in class Group
Returns:
Returns the length of the fields as an int

encode

public byte[] encode(Message message,
                     Context context)
Uses the superclasses encode method to encode the byte array - see Group.java

Parameters:
message - The GroupValue object to be encoded
context - The previous object to keep the data in sync
Returns:
Returns a byte array of the encoded message

decode

public Message decode(java.io.InputStream in,
                      int templateId,
                      BitVectorReader presenceMapReader,
                      Context context)
Decodes the inputStream and creates a new message that contains this information

Parameters:
in - The inputStream to be decoded
templateId - The templateID of the message
presenceMapReader - The BitVector map of the Message
context - The previous object to keep the data in sync
Returns:
Returns a new message object with the newly decoded fieldValue

getValueType

public java.lang.Class getValueType()
Description copied from class: Field
getValueType method declaration

Overrides:
getValueType in class Group
Returns:
Returns the class of the message

toString

public java.lang.String toString()
Overrides:
toString in class Group

createValue

public FieldValue createValue(java.lang.String value)
Description copied from class: Field
createValue method declaration

Overrides:
createValue in class Group
Parameters:
value - The value that the fieldValue that is to be created
Returns:
Creates a new Message object with the specified FieldValue and the passed string value

getFields

public Field[] getFields()
Overrides:
getFields in class Group
Returns:
Returns the field array

getTemplateFields

public Field[] getTemplateFields()
Returns a field array of the current stored fields

Returns:
Returns a field array

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Group

hashCode

public int hashCode()
Overrides:
hashCode in class Group


Copyright © 2006-2008 The LaSalle Technology Group, LLC. All Rights Reserved.