org.openfast.template
Class Field

java.lang.Object
  extended by org.openfast.template.Field
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ComposedScalar, DynamicTemplateReference, Group, Scalar, Sequence, StaticTemplateReference

public abstract class Field
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  java.lang.String id
           
protected  QName key
           
protected  QName name
           
protected  boolean optional
           
 
Constructor Summary
Field(QName name, boolean optional)
          Field Constructor
Field(QName name, QName key, boolean optional)
          Field Constructor
Field(java.lang.String name, java.lang.String key, boolean optional, java.lang.String id)
          Field Constructor
 
Method Summary
 void addAttribute(QName name, java.lang.String value)
           
abstract  FieldValue createValue(java.lang.String value)
          createValue method declaration
abstract  FieldValue decode(java.io.InputStream in, Group template, Context context, BitVectorReader presenceMapReader)
          FieldValue decode method declaration
abstract  byte[] encode(FieldValue value, Group template, Context context, BitVectorBuilder presenceMapBuilder)
          byte[] encode method declaration
 java.lang.String getAttribute(QName name)
           
 java.lang.String getId()
          Find the ID
 QName getKey()
          Find the key
 java.lang.String getName()
          Find the name
 QName getQName()
           
abstract  java.lang.String getTypeName()
          getTypeName method declaration
abstract  java.lang.Class getValueType()
          getValueType method declaration
 boolean hasAttribute(QName attributeName)
           
 boolean isOptional()
          Check to see if the Field is required
abstract  boolean isPresenceMapBitSet(byte[] encoding, FieldValue fieldValue)
          isPresenceMapBitSet method declaration
protected  boolean isPresent(BitVectorReader presenceMapReader)
           
 void setId(java.lang.String id)
          Set the ID
 void setKey(QName key)
          Sets the passed key to the current field key
abstract  boolean usesPresenceMapBit()
          usesPresenceMapBit method declaration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected final QName name

key

protected QName key

optional

protected final boolean optional

id

protected java.lang.String id
Constructor Detail

Field

public Field(QName name,
             boolean optional)
Field Constructor

Parameters:
name - The name of the Field, a string
optional - Determines if the Field is required or not for the data

Field

public Field(QName name,
             QName key,
             boolean optional)
Field Constructor

Parameters:
name - The name of the Field, a string
key - The key of the Field, a string
optional - Determines if the Field is required or not for the data

Field

public Field(java.lang.String name,
             java.lang.String key,
             boolean optional,
             java.lang.String id)
Field Constructor

Parameters:
name - The name of the Field, a string
key - The key of the Field, a string
optional - Determines if the Field is required or not for the data
id - The id string
Method Detail

getName

public java.lang.String getName()
Find the name

Returns:
Returns the name of the Field as a string

getQName

public QName getQName()

isOptional

public boolean isOptional()
Check to see if the Field is required

Returns:
Returns true if the Field isn't required, false otherwise

getKey

public QName getKey()
Find the key

Returns:
Returns the Key as a string

setKey

public void setKey(QName key)
Sets the passed key to the current field key

Parameters:
key - The key to be set

getId

public java.lang.String getId()
Find the ID

Returns:
Returns the ID as a string

setId

public void setId(java.lang.String id)
Set the ID

Parameters:
id - The new ID to set the Field's ID to

hasAttribute

public boolean hasAttribute(QName attributeName)

addAttribute

public void addAttribute(QName name,
                         java.lang.String value)

getAttribute

public java.lang.String getAttribute(QName name)

isPresent

protected boolean isPresent(BitVectorReader presenceMapReader)

encode

public abstract byte[] encode(FieldValue value,
                              Group template,
                              Context context,
                              BitVectorBuilder presenceMapBuilder)
byte[] encode method declaration

Parameters:
value - The FieldValue object to be encoded
template - The Group object to be encoded
context - The previous object to keep the data in sync
presenceMapBuilder - The BitVectorBuilder object to be encoded

decode

public abstract FieldValue decode(java.io.InputStream in,
                                  Group template,
                                  Context context,
                                  BitVectorReader presenceMapReader)
FieldValue decode method declaration

Parameters:
in - The inputStream to be decoded
template - The Group object to be decoded
context - The previous object to keep the data in sync
present -

usesPresenceMapBit

public abstract boolean usesPresenceMapBit()
usesPresenceMapBit method declaration


isPresenceMapBitSet

public abstract boolean isPresenceMapBitSet(byte[] encoding,
                                            FieldValue fieldValue)
isPresenceMapBitSet method declaration

Parameters:
encoding - The byte array to check if it is present
fieldValue - The fieldValue object

getValueType

public abstract java.lang.Class getValueType()
getValueType method declaration


createValue

public abstract FieldValue createValue(java.lang.String value)
createValue method declaration

Parameters:
value - The string of the FieldValue that is to be created

getTypeName

public abstract java.lang.String getTypeName()
getTypeName method declaration



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