ecologylab.xml.internaltranslators.cocoa
Class CocoaTranslator

java.lang.Object
  extended by ecologylab.xml.internaltranslators.cocoa.CocoaTranslator

public class CocoaTranslator
extends java.lang.Object

This class is the main class which provides the functionality of translation of Java classes into the objective class header files.

It uses the same syntactical annotations used the by ecologylab.xml to translate Java objects into xml files. Since it uses the same annotations the data types supported for translation are also the same. The entry point functions into the class are.

Version:
1.0
Author:
Nabeel Shahzad

Constructor Summary
CocoaTranslator()
          Constructor method
 
Method Summary
static void main(java.lang.String[] args)
          Main method to test the working of the library.
 void translateToObjC(java.lang.Class<? extends ElementState> inputClass, java.lang.Appendable appendable)
          The main entry function into the class.
 void translateToObjC(java.lang.Class<? extends ElementState> inputClass, java.io.File directoryLocation)
          Takes an input class to generate an Objective-C version of the file.
 void translateToObjC(java.io.File directoryLocation, java.lang.Class<? extends ElementState>... classes)
          Takes an input class to generate an Objective-C version of the file.
 void translateToObjC(java.io.File directoryLocation, TranslationScope tScope)
          Takes an input class to generate an Objective-C version of the file.
 void translateToObjCHeader(java.lang.Class<? extends ElementState> inputClass, java.lang.Appendable appendable)
          The main entry function into the class.
 void translateToObjCHeader(java.lang.Class<? extends ElementState> inputClass, java.io.File directoryLocation)
          Takes an input class to generate an Objective-C version of the file.
 void translateToObjCImplementation(java.lang.Class<? extends ElementState> inputClass, java.lang.Appendable appendable)
          The main entry function into the class.
 void translateToObjCImplementation(java.lang.Class<? extends ElementState> inputClass, java.io.File directoryLocation)
          Takes an input class to generate an Objective-C version of the file.
 void translateToObjCRecursive(java.lang.Class<? extends ElementState> inputClass, java.lang.Appendable appendable)
          Recursive version of the main function.
 void translateToObjCRecursive(java.lang.Class<? extends ElementState> inputClass, java.io.File directoryLocation)
          Recursive function to generate output files of the @xml_nested objects
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CocoaTranslator

public CocoaTranslator()
Constructor method

Initializes the nestedTranslationHooks member of the class

Method Detail

translateToObjC

public void translateToObjC(java.lang.Class<? extends ElementState> inputClass,
                            java.lang.Appendable appendable)
                     throws java.io.IOException,
                            CocoaTranslationException
The main entry function into the class. Goes through a sequence of steps to convert the Java class file into Objective-C header file. It mainly looks for @xml_attribute , @xml_collection and {@code

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException

translateToObjCHeader

public void translateToObjCHeader(java.lang.Class<? extends ElementState> inputClass,
                                  java.lang.Appendable appendable)
                           throws java.io.IOException,
                                  CocoaTranslationException
The main entry function into the class. Goes through a sequence of steps to convert the Java class file into Objective-C header file. It mainly looks for @xml_attribute , @xml_collection and {@code

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException

translateToObjCImplementation

public void translateToObjCImplementation(java.lang.Class<? extends ElementState> inputClass,
                                          java.lang.Appendable appendable)
                                   throws java.io.IOException,
                                          CocoaTranslationException
The main entry function into the class. Goes through a sequence of steps to convert the Java class file into Objective-C header file. It mainly looks for @xml_attribute , @xml_collection and {@code

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException

translateToObjCRecursive

public void translateToObjCRecursive(java.lang.Class<? extends ElementState> inputClass,
                                     java.lang.Appendable appendable)
                              throws java.io.IOException,
                                     CocoaTranslationException
Recursive version of the main function. Will also be generating Objective-C header outputs for @xml_nested objects

The main entry function into the class. Goes through a sequence of steps to convert the Java class file into Objective-C header file. It mainly looks for @xml_attribute , @xml_collection and {@code

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException

translateToObjC

public void translateToObjC(java.lang.Class<? extends ElementState> inputClass,
                            java.io.File directoryLocation)
                     throws java.io.IOException,
                            CocoaTranslationException
Takes an input class to generate an Objective-C version of the file. Takes the directoryLocation of the files where the file needs to be generated.

This function internally calls the translateToObjC main entry function to generate the required files

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException

translateToObjC

public void translateToObjC(java.io.File directoryLocation,
                            java.lang.Class<? extends ElementState>... classes)
                     throws java.io.IOException,
                            CocoaTranslationException
Takes an input class to generate an Objective-C version of the file. Takes the directoryLocation of the files where the file needs to be generated.

This function internally calls the translateToObjC main entry function to generate the required files

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException

translateToObjC

public void translateToObjC(java.io.File directoryLocation,
                            TranslationScope tScope)
                     throws java.io.IOException,
                            CocoaTranslationException
Takes an input class to generate an Objective-C version of the file. Takes the directoryLocation of the files where the file needs to be generated.

This function internally calls the translateToObjC main entry function to generate the required files

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException

translateToObjCHeader

public void translateToObjCHeader(java.lang.Class<? extends ElementState> inputClass,
                                  java.io.File directoryLocation)
                           throws java.io.IOException,
                                  CocoaTranslationException
Takes an input class to generate an Objective-C version of the file. Takes the directoryLocation of the files where the file needs to be generated.

This function internally calls the translateToObjC main entry function to generate the required files

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException

translateToObjCImplementation

public void translateToObjCImplementation(java.lang.Class<? extends ElementState> inputClass,
                                          java.io.File directoryLocation)
                                   throws java.io.IOException,
                                          CocoaTranslationException
Takes an input class to generate an Objective-C version of the file. Takes the directoryLocation of the files where the file needs to be generated.

This function internally calls the translateToObjC main entry function to generate the required files

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException

translateToObjCRecursive

public void translateToObjCRecursive(java.lang.Class<? extends ElementState> inputClass,
                                     java.io.File directoryLocation)
                              throws java.io.IOException,
                                     CocoaTranslationException
Recursive function to generate output files of the @xml_nested objects

Takes an input class to generate an Objective-C version of the file. Takes the directoryLocation of the files where the file needs to be generated.

This function internally calls the translateToObjC main entry function to generate the required files

Parameters:
inputClass -
appendable -
Throws:
java.io.IOException
CocoaTranslationException
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main method to test the working of the library.

Parameters:
args -
Throws:
java.lang.Exception