alma::tools::idlgen::JavaGenerator Class Reference

Inheritance diagram for alma::tools::idlgen::JavaGenerator:
Inheritance graph
[legend]
Collaboration diagram for alma::tools::idlgen::JavaGenerator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 JavaGenerator (Set xmlTypedefNodes, Set nodesToBeGenerated)
void translate_object_content (IdlObject obj, File writeInto, int translateType)
void translate_interface (IdlObject obj, File writeInto)
void write_helper (IdlObject obj, File writeInto)
void write_holder (IdlObject obj, File writeInto)
PrintWriter fileAccess (File writeInto)
void translate_type (IdlObject obj, PrintWriter output)
void translate_parameter (IdlObject obj, PrintWriter output, int attr)
void addDescriptiveHeader (PrintWriter output, IdlObject obj)
void translate_exception (IdlObject obj, File writeInto)
File createDirectory (String name, File writeInto)

Static Public Member Functions

static NamingConventions getNamingConventions ()

Package Functions

void setIdlStruct2JavaBindingClassMappings (String mappings)
String getXmlBindingClass (String structTypeName)

Private Attributes

Set m_xmlTypedefNodes
Map m_struct2JavaMap
Set m_nodesToBeGenerated

Detailed Description

Author:
hsommer

Constructor & Destructor Documentation

alma::tools::idlgen::JavaGenerator::JavaGenerator ( Set  xmlTypedefNodes,
Set  nodesToBeGenerated 
) [inline]

Member Function Documentation

void alma::tools::idlgen::JavaGenerator::addDescriptiveHeader ( PrintWriter  output,
IdlObject  obj 
) [inline]

uncomment only to trace this...

See also:
org.openorb.compiler.generator.IdlToJava::fullname(IdlObject)
org.openorb.compiler.generator.IdlToJava::addDescriptiveHeader(java.io.PrintWriter, org.openorb.compiler.object.IdlObject)

Referenced by translate_interface().

File alma::tools::idlgen::JavaGenerator::createDirectory ( String  name,
File  writeInto 
) [inline]

Referenced by translate_interface().

PrintWriter alma::tools::idlgen::JavaGenerator::fileAccess ( File  writeInto  )  [inline]

Overloaded to use our StrippingPrintWriter instead of a normal PrintWriter

See also:
IdlToJava::fileAccess(File)
static NamingConventions alma::tools::idlgen::JavaGenerator::getNamingConventions (  )  [inline, static]
String alma::tools::idlgen::JavaGenerator::getXmlBindingClass ( String  structTypeName  )  [inline, package]

Translates an IDL xml wrapper struct to the qualified name of the Java binding class that should appear in the "inner" interface.

References m_struct2JavaMap.

Referenced by translate_parameter(), and translate_type().

void alma::tools::idlgen::JavaGenerator::setIdlStruct2JavaBindingClassMappings ( String  mappings  )  [inline, package]

Sets the mappings from XmlEntityStruct typedefs to Java binding classes. For example, ObsProposal=alma.xmljbind.test.obsproposal.ObsProposal would substitute the Java class on the right side for the IDL type ObsProposal, which is defined as typedef xmlentity::XmlEntityStruct ObsProposal; in the IDL file.

Parameters:
mappings concatenated mappings, separated by ';'

References m_struct2JavaMap.

Referenced by alma::tools::idlgen::XmlIdlCompiler::compile_file().

void alma::tools::idlgen::JavaGenerator::translate_exception ( IdlObject  obj,
File  writeInto 
) [inline]
See also:
org.openorb.compiler.generator.IdlToJava::translate_typedef(org.openorb.compiler.object.IdlObject, java.io.File)

Referenced by translate_interface().

void alma::tools::idlgen::JavaGenerator::translate_interface ( IdlObject  obj,
File  writeInto 
) [inline]
See also:
IdlToJava::translate_interface(IdlObject, File) Method body copied with slight modifications from IdlToJava::translate_interface_operations.

References addDescriptiveHeader(), createDirectory(), m_nodesToBeGenerated, and translate_exception().

void alma::tools::idlgen::JavaGenerator::translate_object_content ( IdlObject  obj,
File  writeInto,
int  translateType 
) [inline]
See also:
IdlToJava::translate_object_content(IdlObject, File, int)

References m_nodesToBeGenerated.

void alma::tools::idlgen::JavaGenerator::translate_parameter ( IdlObject  obj,
PrintWriter  output,
int  attr 
) [inline]
See also:
IdlToJava::translate_parameter(IdlObject, PrintWriter, int)

References getXmlBindingClass(), and m_xmlTypedefNodes.

void alma::tools::idlgen::JavaGenerator::translate_type ( IdlObject  obj,
PrintWriter  output 
) [inline]
See also:
IdlToJava::translate_type(IdlObject, PrintWriter)

References getXmlBindingClass(), and m_xmlTypedefNodes.

Referenced by write_holder().

void alma::tools::idlgen::JavaGenerator::write_helper ( IdlObject  obj,
File  writeInto 
) [inline]

Suppresses generation of helper classes and acts as a dirty shortcut to generate holder classes for typedefs.

According to the OMG IDL2Java mapping, Typedefs for types that are neither arrays nor sequences are unwound to their original type until a simple IDL type or user-defined IDL type (of the non typedef variety) is encountered. Holder classes are generated for sequence and array typedefs only. The unwound type's Holder class is used for the other cases.

A SchedBlock typedef would not get its own SchedBlockHolder according to the mapping rules, but EntityStructHolder would be used instead. For the XML-binding interface, we do need a typesafe holder for the Java binding class. Therefore, an additional holder class must be constructed, outside of the course of the OpenORB compiler, which only attempts to generate the standard mappings. This class generation is conveniently triggered from the write_helper method because it already has the right package info. Sorry for the confusion...

See also:
IdlToJava::write_helper(IdlObject, File)

References m_xmlTypedefNodes, and write_holder().

void alma::tools::idlgen::JavaGenerator::write_holder ( IdlObject  obj,
File  writeInto 
) [inline]
See also:
IdlToJava::write_holder(IdlObject, File)

References translate_type().

Referenced by write_helper().


Member Data Documentation

used as a filter to exclude idl nodes from generation, e.g. interfaces without xml entity objects

Referenced by JavaGenerator(), translate_interface(), and translate_object_content().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2