org.npsnet.xrti.utilities
Class ProxyCompiler

java.lang.Object
  extended byorg.npsnet.xrti.utilities.ProxyCompiler

public class ProxyCompiler
extends java.lang.Object

The XRTI proxy compiler. May be invoked as a command line application or by using the static compileProxies method (from within an Ant task, for instance).

Author:
Andrzej Kapolka

Nested Class Summary
private  class ProxyCompiler.ArrayTypeInformation
          An internal class for information concerning array types.
 
Field Summary
private static java.lang.String ALTERNATIVE
          The alternative element.
private static java.lang.String ARRAY_DATA
          The array data type element.
private  java.util.HashMap arrayTypeInformationMap
          Maps array type names to ArrayTypeInformation objects.
private static java.lang.String ATTRIBUTE
          The attribute element.
private static java.lang.String CARDINALITY
          The cardinality attribute.
private static java.lang.String DATA_TYPE
          The data type attribute.
private static java.lang.String DISCRIMINANT
          The discriminant attribute.
private static java.lang.String ENCODING
          The encoding attribute.
private static java.lang.String ENUMERATED_DATA
          The enumerated data type element.
private static java.lang.String ENUMERATOR
          The enumerator element.
private  java.io.File federationDescriptionDocument
          The federation description document.
private static java.lang.String FIELD
          The field element.
private static java.lang.String FIXED_RECORD_DATA
          The fixed record data type element.
private static java.lang.String HELP
          The help command line argument.
private static java.lang.String HLA_FIXED_ARRAY
          The HLA fixed array encoding.
private static java.lang.String HLA_FIXED_RECORD
          The HLA fixed record encoding.
private static java.lang.String HLA_VARIABLE_ARRAY
          The HLA variable array encoding.
private static java.lang.String HLA_VARIANT_RECORD
          The HLA variant record encoding.
private static java.lang.String INTERACTION_CLASS
          The interaction class element.
private static java.lang.String INTERACTION_LISTENER_NAME
          The interaction listener name command line argument.
private  java.util.HashMap interactionClassElementMap
          Maps interaction classes names to their defining elements.
private  java.lang.String interactionListenerName
          The interaction listener name.
private static java.lang.String INTERACTIONS
          The interactions element.
private static java.lang.String NAME
          The name attribute.
private static java.lang.String NEITHER
          The neither type of sharing.
private static java.lang.String OBJECT_CLASS
          The object class element.
private  java.util.HashMap objectClassElementMap
          Maps object class names to their defining elements.
private static java.lang.String OBJECTS
          The objects element.
private  java.util.HashSet opaqueTypes
          The set of opaque types: types that must be stored as byte arrays because their encodings are non-standard.
private static java.lang.String PACKAGE_PREFIX
          The package prefix command line argument.
private  java.lang.String packagePrefix
          The package prefix.
private static java.lang.String PARAMETER
          The parameter element.
private static java.lang.String PARENTS
          The parents attribute.
private static java.lang.String PROXY_AMBASSADOR_NAME
          The proxy ambassador name command line argument.
private  java.lang.String proxyAmbassadorName
          The proxy ambassador name.
private static java.lang.String PUBLISH
          The publish type of sharing.
private static java.lang.String PUBLISH_SUBSCRIBE
          The publish-and-subscribe type of sharing.
private static java.lang.String REPRESENTATION
          The representation attribute.
private static java.lang.String SEMANTICS
          The semantics attribute.
private static java.lang.String SHARING
          The sharing attribute.
private static java.lang.String SIMPLE_DATA
          The simple data type element.
private  java.util.HashMap simpleTypeRepresentationMap
          Maps simple type names to their representations.
private static java.lang.String SUBSCRIBE
          The subscribe type of sharing.
private static java.lang.String TARGET_DIRECTORY
          The target directory command line argument.
private  java.io.File targetDirectory
          The target directory.
private static java.lang.String VALUES
          The values attribute.
private static java.lang.String VARIANT_RECORD_DATA
          The variant record data type element.
 
Constructor Summary
ProxyCompiler()
           
 
Method Summary
private  java.lang.String capitalize(java.lang.String string)
          Capitalizes the first letter of the specified string.
private  java.util.Vector collateAttributes(org.w3c.dom.Element objectClassElement, java.util.HashMap attributeInterfaceSetMap)
          Collates and returns the list of attributes for the object class described by the specified element, combining attributes inherited from any parents other than the immediate parent and those specific to the class.
private  java.util.Vector collateAttributes2(org.w3c.dom.Element objectClassElement, java.util.HashMap attributeInterfaceSetMap)
          Collates and returns the list of attributes for the object class described by the specified element, combining attributes inherited from the immediate parent, those from any other parents, and those specific to the class.
private  java.util.Vector collateParameters(org.w3c.dom.Element interactionClassElement)
          Collates and returns the list of parameters for the interaction class described by the specified element, combining parameters inherited from the immediate parent, those from any other parents, and those specific to the class.
 void compileProxies()
          Generates Java source code for a set of proxy classes corresponding to the object and interaction classes described in the federation description document.
private  java.lang.String convertToIdentifier(java.lang.String anyName)
          Converts the specified free-form name to a reasonable Java identifier by removing whitespace and illegal characters and so on.
private  java.lang.String convertToJavaClassName(java.lang.String anyName)
          Converts the specified free-form name to a reasonable Java class name by removing whitespace and illegal characters, modifying capitalization, and so on.
private  java.lang.String formatCommentBody(int indentLevel, java.lang.String commentBody)
          Formats the body of a comment, adding asterisks at the beginning of each line.
private  void generateDataTypes(org.w3c.dom.Document fddDocument)
          Generates data type classes.
private  void generateEnumeratedDataType(org.w3c.dom.Element typeElement)
          Generates an enumerated data type class.
private  void generateFixedRecordDataType(org.w3c.dom.Element typeElement)
          Generates a fixed record data type class.
private  java.lang.String generateIndentString(int indentLevel)
          Generates an indentation string for the specified level of indentation.
private  void generateInteractionListener(org.w3c.dom.Document fddDocument)
          Generates the interaction listener source file.
private  void generateObjectInstanceInterface(org.w3c.dom.Element classElement, java.lang.String superInterfaceName)
          Generates an object instance interface source file.
private  void generateObjectInstanceInterfaces(org.w3c.dom.Document fddDocument)
          Generates the object instance interface source files.
private  void generateObjectInstanceListener(org.w3c.dom.Element classElement)
          Generates an object instance listener source file.
private  void generateObjectInstanceListeners(org.w3c.dom.Document fddDocument)
          Generates the object instance listener source files.
private  void generateObjectInstanceProxies(org.w3c.dom.Document fddDocument)
          Generates the object instance proxy source files.
private  void generateObjectInstanceProxy(org.w3c.dom.Element classElement, java.lang.String superClassName)
          Generates an object instance proxy source file.
private  void generateProxyAmbassador(org.w3c.dom.Document fddDocument)
          Generates the proxy ambassador source file.
private  void generateVariantRecordDataType(org.w3c.dom.Element typeElement)
          Generates a variant record data type class.
 java.io.File getFederationDescriptionDocument()
          Returns the location of the federation description document.
 java.lang.String getInteractionListenerName()
          Returns the (unprefixed) name of the interaction listener interface.
private  java.lang.String getPackageName(java.lang.String className)
          Returns the name of the package specified by the given fully qualified class name.
 java.lang.String getPackagePrefix()
          Returns the package prefix.
 java.lang.String getProxyAmbassadorName()
          Returns the (unprefixed) name of the proxy ambassador class.
 java.io.File getTargetDirectory()
          Returns the target directory in which to place generated source files.
private  java.lang.String javaTypeForBasicRepresentation(java.lang.String basicRepresentationName)
          Returns the Java type name corresponding to the specified basic representation name.
private  java.lang.String javaTypeForDataType(java.lang.String dataTypeName)
          Returns the Java type name corresponding to the specified data type name.
static void main(java.lang.String[] args)
          The application entry point.
private  void printClassComment(java.io.PrintStream ps, java.lang.String body)
          Prints a Javadoc-style class comment.
private  void printDeserializationBlock(java.io.PrintStream ps, int indentLevel, char iteratorVariable, java.lang.String dataTypeName, java.lang.String variableName, java.lang.String streamName)
          Prints a code block that will deserialize the specified variable from the given stream.
private  boolean printDiscoverObjectInstanceBlock(java.io.PrintStream ps, org.w3c.dom.Element objectClassElement, boolean first)
          Prints the discover object instance block for the specified object class element and its sub-elements.
private  void printInitToDefaultBlock(java.io.PrintStream ps, java.lang.String dataTypeName, java.lang.String variableName)
          Prints a code block that will initialize the specified variable to a default state.
private  void printInteractionHandleDeclarations(java.io.PrintStream ps, org.w3c.dom.Element interactionClassElement)
          Prints the set of interaction handle declarations for the specified interaction class element and its sub-elements.
private  void printInteractionHandleInitializations(java.io.PrintStream ps, org.w3c.dom.Element interactionClassElement)
          Prints the set of interaction handle initializations for the specified interaction class element and its sub-elements.
private  void printObjectClassHandleDeclarations(java.io.PrintStream ps, org.w3c.dom.Element objectClassElement)
          Prints the set of object class handle declarations for the specified object class element and its sub-elements.
private  void printObjectClassHandleInitializations(java.io.PrintStream ps, org.w3c.dom.Element objectClassElement)
          Prints the set of object class handle initializations for the specified object class element and its sub-elements.
private  void printObjectClassPublicationSubscriptions(java.io.PrintStream ps, org.w3c.dom.Element objectClassElement)
          Prints the set of object class publications and subscriptions for the specified object class element and its sub-elements.
private  void printObjectInstanceProxyConstructors(java.io.PrintStream ps, org.w3c.dom.Element objectClassElement)
          Prints the set of object instance proxy constructors for the specified object class element and its sub-elements.
private  boolean printReceiveInteractionBlock(java.io.PrintStream ps, org.w3c.dom.Element interactionClassElement, boolean first)
          Prints the receive interaction block for the specified interaction class element and its sub-elements.
private  void printReceiveInteractionDeclarations(java.io.PrintStream ps, org.w3c.dom.Element interactionClassElement)
          Prints the set of receive-interaction declarations for the specified interaction class element and its sub-elements.
private  void printSendInteractionMethods(java.io.PrintStream ps, org.w3c.dom.Element interactionClassElement)
          Prints the set of send-interaction methods for the specified interaction class element and its sub-elements.
private  void printSerializationBlock(java.io.PrintStream ps, int indentLevel, char iteratorVariable, java.lang.String dataTypeName, java.lang.String variableName, java.lang.String streamName)
          Prints a code block that will serialize the specified variable to the given stream.
private  void printVariableComment(java.io.PrintStream ps, java.lang.String body)
          Prints a Javadoc-style variable comment.
 void setFederationDescriptionDocument(java.io.File pFederationDescriptionDocument)
          Sets the location of the federation description document.
 void setInteractionListenerName(java.lang.String pInteractionListenerName)
          Sets the (unprefixed) name of the interaction listener interface.
 void setPackagePrefix(java.lang.String pPackagePrefix)
          Sets the package prefix.
 void setProxyAmbassadorName(java.lang.String pProxyAmbassadorName)
          Sets the (unprefixed) name of the proxy ambassador class.
 void setTargetDirectory(java.io.File pTargetDirectory)
          Sets the target directory in which to place generated source files.
private  java.lang.String spacer(java.lang.String string)
          Generates a string of the same length as the parameter, consisting only of space characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TARGET_DIRECTORY

private static final java.lang.String TARGET_DIRECTORY
The target directory command line argument.

See Also:
Constant Field Values

PACKAGE_PREFIX

private static final java.lang.String PACKAGE_PREFIX
The package prefix command line argument.

See Also:
Constant Field Values

PROXY_AMBASSADOR_NAME

private static final java.lang.String PROXY_AMBASSADOR_NAME
The proxy ambassador name command line argument.

See Also:
Constant Field Values

INTERACTION_LISTENER_NAME

private static final java.lang.String INTERACTION_LISTENER_NAME
The interaction listener name command line argument.

See Also:
Constant Field Values

HELP

private static final java.lang.String HELP
The help command line argument.

See Also:
Constant Field Values

SIMPLE_DATA

private static final java.lang.String SIMPLE_DATA
The simple data type element.

See Also:
Constant Field Values

ARRAY_DATA

private static final java.lang.String ARRAY_DATA
The array data type element.

See Also:
Constant Field Values

ENUMERATED_DATA

private static final java.lang.String ENUMERATED_DATA
The enumerated data type element.

See Also:
Constant Field Values

ENUMERATOR

private static final java.lang.String ENUMERATOR
The enumerator element.

See Also:
Constant Field Values

FIXED_RECORD_DATA

private static final java.lang.String FIXED_RECORD_DATA
The fixed record data type element.

See Also:
Constant Field Values

VARIANT_RECORD_DATA

private static final java.lang.String VARIANT_RECORD_DATA
The variant record data type element.

See Also:
Constant Field Values

FIELD

private static final java.lang.String FIELD
The field element.

See Also:
Constant Field Values

ALTERNATIVE

private static final java.lang.String ALTERNATIVE
The alternative element.

See Also:
Constant Field Values

OBJECTS

private static final java.lang.String OBJECTS
The objects element.

See Also:
Constant Field Values

OBJECT_CLASS

private static final java.lang.String OBJECT_CLASS
The object class element.

See Also:
Constant Field Values

ATTRIBUTE

private static final java.lang.String ATTRIBUTE
The attribute element.

See Also:
Constant Field Values

INTERACTIONS

private static final java.lang.String INTERACTIONS
The interactions element.

See Also:
Constant Field Values

INTERACTION_CLASS

private static final java.lang.String INTERACTION_CLASS
The interaction class element.

See Also:
Constant Field Values

PARAMETER

private static final java.lang.String PARAMETER
The parameter element.

See Also:
Constant Field Values

NAME

private static final java.lang.String NAME
The name attribute.

See Also:
Constant Field Values

SEMANTICS

private static final java.lang.String SEMANTICS
The semantics attribute.

See Also:
Constant Field Values

REPRESENTATION

private static final java.lang.String REPRESENTATION
The representation attribute.

See Also:
Constant Field Values

VALUES

private static final java.lang.String VALUES
The values attribute.

See Also:
Constant Field Values

DATA_TYPE

private static final java.lang.String DATA_TYPE
The data type attribute.

See Also:
Constant Field Values

CARDINALITY

private static final java.lang.String CARDINALITY
The cardinality attribute.

See Also:
Constant Field Values

ENCODING

private static final java.lang.String ENCODING
The encoding attribute.

See Also:
Constant Field Values

DISCRIMINANT

private static final java.lang.String DISCRIMINANT
The discriminant attribute.

See Also:
Constant Field Values

PARENTS

private static final java.lang.String PARENTS
The parents attribute.

See Also:
Constant Field Values

SHARING

private static final java.lang.String SHARING
The sharing attribute.

See Also:
Constant Field Values

HLA_FIXED_ARRAY

private static final java.lang.String HLA_FIXED_ARRAY
The HLA fixed array encoding.

See Also:
Constant Field Values

HLA_VARIABLE_ARRAY

private static final java.lang.String HLA_VARIABLE_ARRAY
The HLA variable array encoding.

See Also:
Constant Field Values

HLA_FIXED_RECORD

private static final java.lang.String HLA_FIXED_RECORD
The HLA fixed record encoding.

See Also:
Constant Field Values

HLA_VARIANT_RECORD

private static final java.lang.String HLA_VARIANT_RECORD
The HLA variant record encoding.

See Also:
Constant Field Values

PUBLISH

private static final java.lang.String PUBLISH
The publish type of sharing.

See Also:
Constant Field Values

SUBSCRIBE

private static final java.lang.String SUBSCRIBE
The subscribe type of sharing.

See Also:
Constant Field Values

PUBLISH_SUBSCRIBE

private static final java.lang.String PUBLISH_SUBSCRIBE
The publish-and-subscribe type of sharing.

See Also:
Constant Field Values

NEITHER

private static final java.lang.String NEITHER
The neither type of sharing.

See Also:
Constant Field Values

federationDescriptionDocument

private java.io.File federationDescriptionDocument
The federation description document.


targetDirectory

private java.io.File targetDirectory
The target directory.


packagePrefix

private java.lang.String packagePrefix
The package prefix.


proxyAmbassadorName

private java.lang.String proxyAmbassadorName
The proxy ambassador name.


interactionListenerName

private java.lang.String interactionListenerName
The interaction listener name.


simpleTypeRepresentationMap

private java.util.HashMap simpleTypeRepresentationMap
Maps simple type names to their representations.


opaqueTypes

private java.util.HashSet opaqueTypes
The set of opaque types: types that must be stored as byte arrays because their encodings are non-standard.


arrayTypeInformationMap

private java.util.HashMap arrayTypeInformationMap
Maps array type names to ArrayTypeInformation objects.


interactionClassElementMap

private java.util.HashMap interactionClassElementMap
Maps interaction classes names to their defining elements.


objectClassElementMap

private java.util.HashMap objectClassElementMap
Maps object class names to their defining elements.

Constructor Detail

ProxyCompiler

public ProxyCompiler()
Method Detail

main

public static void main(java.lang.String[] args)
The application entry point.

Parameters:
args - the command line arguments

setFederationDescriptionDocument

public void setFederationDescriptionDocument(java.io.File pFederationDescriptionDocument)
Sets the location of the federation description document.

Parameters:
pFederationDescriptionDocument - the location of the federation description document

getFederationDescriptionDocument

public java.io.File getFederationDescriptionDocument()
Returns the location of the federation description document.

Returns:
the location of the federation description document

setTargetDirectory

public void setTargetDirectory(java.io.File pTargetDirectory)
Sets the target directory in which to place generated source files.

Parameters:
pTargetDirectory - the target directory in which to place generated source files

getTargetDirectory

public java.io.File getTargetDirectory()
Returns the target directory in which to place generated source files.

Returns:
the target directory in which to place generated source files

setPackagePrefix

public void setPackagePrefix(java.lang.String pPackagePrefix)
Sets the package prefix.

Parameters:
pPackagePrefix - the package prefix

getPackagePrefix

public java.lang.String getPackagePrefix()
Returns the package prefix.

Returns:
the package prefix

setProxyAmbassadorName

public void setProxyAmbassadorName(java.lang.String pProxyAmbassadorName)
Sets the (unprefixed) name of the proxy ambassador class.

Parameters:
pProxyAmbassadorName - the (unprefixed) name of the proxy ambassador class

getProxyAmbassadorName

public java.lang.String getProxyAmbassadorName()
Returns the (unprefixed) name of the proxy ambassador class.

Returns:
the (unprefixed) name of the proxy ambassador class

setInteractionListenerName

public void setInteractionListenerName(java.lang.String pInteractionListenerName)
Sets the (unprefixed) name of the interaction listener interface.

Parameters:
pInteractionListenerName - the (unprefixed) name of the interaction listener interface

getInteractionListenerName

public java.lang.String getInteractionListenerName()
Returns the (unprefixed) name of the interaction listener interface.

Returns:
the (unprefixed) name of the interaction listener interface

compileProxies

public void compileProxies()
                    throws CouldNotOpenFDD,
                           ErrorReadingFDD,
                           TypeConflictException
Generates Java source code for a set of proxy classes corresponding to the object and interaction classes described in the federation description document. Any existing files will be overwritten.

Throws:
CouldNotOpenFDD - if the federation description document could not be opened
ErrorReadingFDD - if the federation description document is invalid
TypeConflictException - if a type conflict is encountered

capitalize

private java.lang.String capitalize(java.lang.String string)
Capitalizes the first letter of the specified string.

Parameters:
string - the string to capitalize
Returns:
the capitalized string

spacer

private java.lang.String spacer(java.lang.String string)
Generates a string of the same length as the parameter, consisting only of space characters.

Parameters:
string - the string whose length is to be copied
Returns:
the space string

convertToJavaClassName

private java.lang.String convertToJavaClassName(java.lang.String anyName)
Converts the specified free-form name to a reasonable Java class name by removing whitespace and illegal characters, modifying capitalization, and so on.

Parameters:
anyName - the free-form name to convert
Returns:
the converted name

convertToIdentifier

private java.lang.String convertToIdentifier(java.lang.String anyName)
Converts the specified free-form name to a reasonable Java identifier by removing whitespace and illegal characters and so on.

Parameters:
anyName - the free-form name to convert
Returns:
the converted name

getPackageName

private java.lang.String getPackageName(java.lang.String className)
Returns the name of the package specified by the given fully qualified class name.

Parameters:
className - the fully qualified class name
Returns:
the package name, or null for the base package

generateIndentString

private java.lang.String generateIndentString(int indentLevel)
Generates an indentation string for the specified level of indentation.

Parameters:
indentLevel - the level of indentation desired
Returns:
the indentation string

formatCommentBody

private java.lang.String formatCommentBody(int indentLevel,
                                           java.lang.String commentBody)
Formats the body of a comment, adding asterisks at the beginning of each line.

Parameters:
indentLevel - the level of indentation required
commentBody - the comment body to format
Returns:
the formatted body

printClassComment

private void printClassComment(java.io.PrintStream ps,
                               java.lang.String body)
Prints a Javadoc-style class comment.

Parameters:
ps - the print stream to write the comment to
body - the body of the comment

printVariableComment

private void printVariableComment(java.io.PrintStream ps,
                                  java.lang.String body)
Prints a Javadoc-style variable comment.

Parameters:
ps - the print stream to write the comment to
body - the body of the comment

javaTypeForBasicRepresentation

private java.lang.String javaTypeForBasicRepresentation(java.lang.String basicRepresentationName)
Returns the Java type name corresponding to the specified basic representation name.

Parameters:
basicRepresentationName - the basic representation name
Returns:
the corresponding Java type name

javaTypeForDataType

private java.lang.String javaTypeForDataType(java.lang.String dataTypeName)
Returns the Java type name corresponding to the specified data type name.

Parameters:
dataTypeName - the data type name
Returns:
the corresponding Java type name

printSerializationBlock

private void printSerializationBlock(java.io.PrintStream ps,
                                     int indentLevel,
                                     char iteratorVariable,
                                     java.lang.String dataTypeName,
                                     java.lang.String variableName,
                                     java.lang.String streamName)
Prints a code block that will serialize the specified variable to the given stream.

Parameters:
ps - the print stream to write the code block to
indentLevel - the level of indentation to use
iteratorVariable - the name of the iterator variable to use ('i', 'j', 'k'...)
dataTypeName - the name of the variable's data type
variableName - the name of the variable
streamName - the name of the stream

printDeserializationBlock

private void printDeserializationBlock(java.io.PrintStream ps,
                                       int indentLevel,
                                       char iteratorVariable,
                                       java.lang.String dataTypeName,
                                       java.lang.String variableName,
                                       java.lang.String streamName)
Prints a code block that will deserialize the specified variable from the given stream.

Parameters:
ps - the print stream to write the code block to
indentLevel - the level of indentation to use
iteratorVariable - the name of the iterator variable to use ('i', 'j', 'k'...)
dataTypeName - the name of the variable's data type
variableName - the name of the variable
streamName - the name of the stream

printInitToDefaultBlock

private void printInitToDefaultBlock(java.io.PrintStream ps,
                                     java.lang.String dataTypeName,
                                     java.lang.String variableName)
Prints a code block that will initialize the specified variable to a default state.

Parameters:
ps - the print stream to write the code block to
dataTypeName - the name of the variable's data type
variableName - the name of the variable

generateDataTypes

private void generateDataTypes(org.w3c.dom.Document fddDocument)
Generates data type classes.

Parameters:
fddDocument - the parsed federation description document

generateEnumeratedDataType

private void generateEnumeratedDataType(org.w3c.dom.Element typeElement)
Generates an enumerated data type class.

Parameters:
typeElement - the element containing the type description

generateFixedRecordDataType

private void generateFixedRecordDataType(org.w3c.dom.Element typeElement)
Generates a fixed record data type class.

Parameters:
typeElement - the element containing the type description

generateVariantRecordDataType

private void generateVariantRecordDataType(org.w3c.dom.Element typeElement)
Generates a variant record data type class.

Parameters:
typeElement - the element containing the type description

generateProxyAmbassador

private void generateProxyAmbassador(org.w3c.dom.Document fddDocument)
                              throws TypeConflictException
Generates the proxy ambassador source file.

Parameters:
fddDocument - the parsed federation description document
Throws:
TypeConflictException - if a type conflict is encountered

collateParameters

private java.util.Vector collateParameters(org.w3c.dom.Element interactionClassElement)
                                    throws TypeConflictException
Collates and returns the list of parameters for the interaction class described by the specified element, combining parameters inherited from the immediate parent, those from any other parents, and those specific to the class.

Parameters:
interactionClassElement - the element describing the interaction class
Returns:
the complete list of elements describing the interaction's parameters
Throws:
TypeConflictException - if a type conflict is detected

printInteractionHandleDeclarations

private void printInteractionHandleDeclarations(java.io.PrintStream ps,
                                                org.w3c.dom.Element interactionClassElement)
                                         throws TypeConflictException
Prints the set of interaction handle declarations for the specified interaction class element and its sub-elements.

Parameters:
ps - the stream to print to
interactionClassElement - the interaction class element to process
Throws:
TypeConflictException - if a type conflict is detected

printObjectClassHandleDeclarations

private void printObjectClassHandleDeclarations(java.io.PrintStream ps,
                                                org.w3c.dom.Element objectClassElement)
Prints the set of object class handle declarations for the specified object class element and its sub-elements.

Parameters:
ps - the stream to print to
objectClassElement - the object class element to process

printInteractionHandleInitializations

private void printInteractionHandleInitializations(java.io.PrintStream ps,
                                                   org.w3c.dom.Element interactionClassElement)
                                            throws TypeConflictException
Prints the set of interaction handle initializations for the specified interaction class element and its sub-elements.

Parameters:
ps - the stream to print to
interactionClassElement - the interaction class element to process
Throws:
TypeConflictException - if a type conflict is detected

printObjectClassHandleInitializations

private void printObjectClassHandleInitializations(java.io.PrintStream ps,
                                                   org.w3c.dom.Element objectClassElement)
                                            throws TypeConflictException
Prints the set of object class handle initializations for the specified object class element and its sub-elements.

Parameters:
ps - the stream to print to
objectClassElement - the object class element to process
Throws:
TypeConflictException - if a type conflict is detected

printObjectClassPublicationSubscriptions

private void printObjectClassPublicationSubscriptions(java.io.PrintStream ps,
                                                      org.w3c.dom.Element objectClassElement)
                                               throws TypeConflictException
Prints the set of object class publications and subscriptions for the specified object class element and its sub-elements.

Parameters:
ps - the stream to print to
objectClassElement - the object class element to process
Throws:
TypeConflictException - if a type conflict is detected

printObjectInstanceProxyConstructors

private void printObjectInstanceProxyConstructors(java.io.PrintStream ps,
                                                  org.w3c.dom.Element objectClassElement)
Prints the set of object instance proxy constructors for the specified object class element and its sub-elements.

Parameters:
ps - the stream to print to
objectClassElement - the object class element to process

printSendInteractionMethods

private void printSendInteractionMethods(java.io.PrintStream ps,
                                         org.w3c.dom.Element interactionClassElement)
                                  throws TypeConflictException
Prints the set of send-interaction methods for the specified interaction class element and its sub-elements.

Parameters:
ps - the stream to print to
interactionClassElement - the interaction class element to process
Throws:
TypeConflictException - if a type conflict is detected

printReceiveInteractionBlock

private boolean printReceiveInteractionBlock(java.io.PrintStream ps,
                                             org.w3c.dom.Element interactionClassElement,
                                             boolean first)
                                      throws TypeConflictException
Prints the receive interaction block for the specified interaction class element and its sub-elements.

Parameters:
ps - the stream to print to
interactionClassElement - the interaction class element to process
first - whether or not this is the first block being printed
Returns:
the new value for first: true if the first block has not been printed, false if it has been
Throws:
TypeConflictException - if a type conflict is detected

printDiscoverObjectInstanceBlock

private boolean printDiscoverObjectInstanceBlock(java.io.PrintStream ps,
                                                 org.w3c.dom.Element objectClassElement,
                                                 boolean first)
Prints the discover object instance block for the specified object class element and its sub-elements.

Parameters:
ps - the stream to print to
objectClassElement - the object class element to process
first - whether or not this is the first block being printed
Returns:
the new value for first: true if the first block has not been printed, false if it has been

generateInteractionListener

private void generateInteractionListener(org.w3c.dom.Document fddDocument)
                                  throws TypeConflictException
Generates the interaction listener source file.

Parameters:
fddDocument - the parsed federation description document
Throws:
TypeConflictException - if a type conflict is detected

printReceiveInteractionDeclarations

private void printReceiveInteractionDeclarations(java.io.PrintStream ps,
                                                 org.w3c.dom.Element interactionClassElement)
                                          throws TypeConflictException
Prints the set of receive-interaction declarations for the specified interaction class element and its sub-elements.

Parameters:
ps - the stream to print to
interactionClassElement - the interaction class element to process
Throws:
TypeConflictException - if a type conflict is detected

generateObjectInstanceProxies

private void generateObjectInstanceProxies(org.w3c.dom.Document fddDocument)
                                    throws TypeConflictException
Generates the object instance proxy source files.

Parameters:
fddDocument - the parsed federation description document
Throws:
TypeConflictException - if a type conflict is detected

generateObjectInstanceInterfaces

private void generateObjectInstanceInterfaces(org.w3c.dom.Document fddDocument)
Generates the object instance interface source files.

Parameters:
fddDocument - the parsed federation description document

generateObjectInstanceListeners

private void generateObjectInstanceListeners(org.w3c.dom.Document fddDocument)
Generates the object instance listener source files.

Parameters:
fddDocument - the parsed federation description document

generateObjectInstanceProxy

private void generateObjectInstanceProxy(org.w3c.dom.Element classElement,
                                         java.lang.String superClassName)
                                  throws TypeConflictException
Generates an object instance proxy source file.

Parameters:
classElement - the object instance class element containing the relevant information
superClassName - the name of the proxy superclass
Throws:
TypeConflictException - if a type conflict is detected

collateAttributes

private java.util.Vector collateAttributes(org.w3c.dom.Element objectClassElement,
                                           java.util.HashMap attributeInterfaceSetMap)
                                    throws TypeConflictException
Collates and returns the list of attributes for the object class described by the specified element, combining attributes inherited from any parents other than the immediate parent and those specific to the class. Also populates the specified attribute-to-interface-set map.

Parameters:
objectClassElement - the element describing the object class
attributeInterfaceSetMap - maps attribute names to sets of interfaces that contain the attribute
Returns:
the complete list of elements describing the object's attributes
Throws:
TypeConflictException - if a type conflict is detected

collateAttributes2

private java.util.Vector collateAttributes2(org.w3c.dom.Element objectClassElement,
                                            java.util.HashMap attributeInterfaceSetMap)
                                     throws TypeConflictException
Collates and returns the list of attributes for the object class described by the specified element, combining attributes inherited from the immediate parent, those from any other parents, and those specific to the class. Also populates the specified attribute-to-interface-set map.

Parameters:
objectClassElement - the element describing the object class
attributeInterfaceSetMap - maps attribute names to sets of interfaces containing the attribute
Returns:
the complete list of elements describing the object's attributes
Throws:
TypeConflictException - if a type conflict is detected

generateObjectInstanceInterface

private void generateObjectInstanceInterface(org.w3c.dom.Element classElement,
                                             java.lang.String superInterfaceName)
Generates an object instance interface source file.

Parameters:
classElement - the object instance class element containing the relevant information
superInterfaceName - the name of the superinterface

generateObjectInstanceListener

private void generateObjectInstanceListener(org.w3c.dom.Element classElement)
Generates an object instance listener source file.

Parameters:
classElement - the object instance class element containing the relevant information