fulmine.model.field.containerdefinition
Interface IContainerDefinitionField

All Superinterfaces:
Cloneable, IAddressable, IComponent, IDescriptor, IDestroyable, IEvent, IEventSource, IField, ILifeCycle, IWireIdentityRegistry, IWireState
All Known Implementing Classes:
ContainerDefinitionField

public interface IContainerDefinitionField
extends IField, IWireIdentityRegistry, Cloneable

A definition of the IField objects in an IContainer object. Every container has a definition. The definition itself is a field of the container.

There are 2 forms of definitions; dynamic and static. Static definitions have a fixed structure that does not change during runtime (discounting the initial construction and addition of fields), they are immutable. Dynamic definitions have a variable structure. This definition distinction arises to support static and dynamic containers.

Dynamic containers (e.g. Record) have a definition per instance, held in a field. These containers have an indeterminate field population, thus each dynamic container instance requires its own definition to express the field population of the container.

Static container types have a set field population, defined by a static definition. Thus static containers have a definition per container type not instance.

The definition also serves as the wire identity registry for the fields defined in the container.

Author:
Ramon Servadei

Method Summary
 void add(IField field)
          Add the field to the definition.
 boolean containsDefinition(int wireCode)
          Determines if the container definition contains a DescriptorField for a field identified by its integer wire identity.
 IField createField(int wireCode)
          Create the field identified by its wire code.
 byte getApplication(int wireCode)
          Get the application code for the field identified by its wire identity
 String getIdentityForWireCode(int wireCode)
          Get the IWF wire identity code
 short getPermission(int wireCode)
          Get the permission code for the field identified by its wire identity
 int getWireCodeForIdentity(String identity)
          Get the IWF wire identity code for the IField identified by the string
 boolean isDynamic()
          Identify if the definition is dynamic (i.e.
 void populate(IContainer container)
          Create the fields in the container from this definition.
 void remove(IField field)
          Remove the DescriptorField with the same identity as the field argument from this definition.
 void resetChanges()
          Reset all changes.
 
Methods inherited from interface fulmine.model.field.IField
addedToContainer, clone, getApplication, getContainer, getPermission, getValue, getValueAsString, removedFromContainer, setValueFromString
 
Methods inherited from interface fulmine.protocol.wire.IWireState
readState, writeState
 
Methods inherited from interface fulmine.event.IEventSource
addEvent, addListener, getEventSourceGroupId, getListeners, removeListener, removeListeners
 
Methods inherited from interface fulmine.IDescriptor
toDetailedString, toIdentityString
 
Methods inherited from interface fulmine.ILifeCycle
isActive, start
 
Methods inherited from interface fulmine.IDestroyable
destroy
 
Methods inherited from interface fulmine.IAddressable
getAddress, getDomain, getIdentity, getType
 
Methods inherited from interface fulmine.event.IEvent
getDrivingFrame, getFrame, getSource, getTriggerEvent, setTriggerEvent
 
Methods inherited from interface fulmine.IDescriptor
toDetailedString, toIdentityString
 
Methods inherited from interface fulmine.IAddressable
getAddress, getDomain, getIdentity, getType
 
Methods inherited from interface fulmine.protocol.wire.IWireIdentityRegistry
getIdentityFor, getWireIdentityFor
 

Method Detail

isDynamic

boolean isDynamic()
Identify if the definition is dynamic (i.e. mutable)

Returns:
true if the definition is dynamic

getIdentityForWireCode

String getIdentityForWireCode(int wireCode)
Get the IWF wire identity code

Parameters:
wireCode - the integer value of the IWF wire identity
Returns:
the string identity of the associated IField declared for this IWF wire identity
Throws:
IllegalArgumentException - if no field is found

getWireCodeForIdentity

int getWireCodeForIdentity(String identity)
Get the IWF wire identity code for the IField identified by the string

Parameters:
identity - the string identity of the IField to find
Returns:
the integer value of the IWF wire identity for the IField
Throws:
IllegalArgumentException - if no field is found

populate

void populate(IContainer container)
Create the fields in the container from this definition.

Parameters:
container - the container to populate

add

void add(IField field)
Add the field to the definition. The field is inspected and a DescriptorField is constructed to represent the field. The descriptor field is held in the definition.

Parameters:
field - the field to represent with a DescriptorField

remove

void remove(IField field)
Remove the DescriptorField with the same identity as the field argument from this definition.

Parameters:
field - the field representation to remove from the definition

resetChanges

void resetChanges()
Reset all changes.


containsDefinition

boolean containsDefinition(int wireCode)
Determines if the container definition contains a DescriptorField for a field identified by its integer wire identity.

Parameters:
wireCode - the integer wire identity for the field
Returns:
true if there is a DescriptorField for this integer wire identity

createField

IField createField(int wireCode)
Create the field identified by its wire code. This only works if there is a DescriptorField for the wire identity.

Parameters:
wireCode - the integer wire identity for the field
Returns:
the created IField or null if there was no DescriptorField for this integer wire identity
See Also:
containsDefinition(int)

getPermission

short getPermission(int wireCode)
Get the permission code for the field identified by its wire identity

Parameters:
wireCode - the integer wire identity for the field
Returns:
the permission code for the field
See Also:
IPermissionProfile

getApplication

byte getApplication(int wireCode)
Get the application code for the field identified by its wire identity

Parameters:
wireCode - the integer wire identity for the field
Returns:
the application code for the field
See Also:
IPermissionProfile


Copyright © 2007-2009. All Rights Reserved.