Methods Summary |
---|
public void | closeIdlFile(java.lang.StringBuffer outBuff, java.lang.StringBuffer exceptions)
String strExceptions = new String( exceptions );
String strTypes = new String( types );
String strIdlFunctionality = new String( outBuff );
if (! strExceptions.equals("")) outputFile.println( strExceptions );
if (! strTypes.equals("")) outputFile.println( strTypes );
if (! strIdlFunctionality.equals("")) outputFile.println( strIdlFunctionality );
outputFile.println ( " };" );
outputFile.println ( "" );
outputFile.println ( "#endif" );
outputFile.println ( "" );
for ( int i = 0; i < countModules; i++ )
outputFile.println ( "};" );
outputFile.flush ();
outputFile.close ();
|
public void | convertCppToIdlType(java.lang.String type)
convertedType = "";
if ((! type.endsWith( "[" )) && (! type.endsWith( "<" ))){
convertedType = getConvertedCppType( type );
if ( convertedType == null ){
StringTokenizer tokenType = new StringTokenizer( type, "*&[]<>" );
if ( tokenType.hasMoreElements() ) {
convertedType = tokenType.nextToken();
putIncludeFile( convertedType.trim() );
}
}
}
|
public void | createBaseDataTables()
types = new StringBuffer();
includeFiles = new Hashtable();
|
private void | createCppToIdlTable()
idlFiles = new Hashtable();
cppToIdlTable = new Hashtable();
for ( int i=0; i < ( cppToIdlTypes.length ); i++ ){
cppToIdlTable.put( cppToIdlTypes[i][0], cppToIdlTypes[i][1] );
}
|
public boolean | creationIdlFile(java.lang.String language, java.lang.String path, java.lang.String fileName, java.lang.String extenceFiles)
this.language = language;
try{
int position = fileName.lastIndexOf( idlBaseFunctionality.postfix );
idlFileName = fileName.substring(0,position);
extences = extenceFiles;
putIdlFile( idlFileName );
if ( language.equals( UMLElement.CPP )){
path += "idl" + File.separator;
File file = new File(path);
if (! file.exists()) {
file.mkdir();
}
}
outputFile = new PrintWriter ( new FileWriter( path + idlFileName + ".idl" ));
return true;
}
catch (Exception e){
e.printStackTrace();
return false;
}
|
public void | doIt(oisoft.togetherx.scriptapi.APIManager apiManager)
this.apiManager = apiManager;
rootPackage = apiManager.getUMLModel().getRootPackage();
idlBaseFunctionality = new IDL(this);
createCppToIdlTable();
idlBaseFunctionality.idlFabric(apiManager, idlCORBA);
|
public void | genereateIdlFileTitle()
outputFile.println ( "" );
outputFile.println ( "// Generated by Together" );
outputFile.println ( "" );
outputFile.println ( "" );
countModules = 0;
int iPreviousPos = 0;
int iCurrentPos = fullQualifiedName.indexOf( "." );
while ( iCurrentPos >= 0 ){
String strNamePackage = fullQualifiedName.substring( iPreviousPos, iCurrentPos );
iPreviousPos = iCurrentPos + 1;
iCurrentPos = fullQualifiedName.indexOf( ".", iPreviousPos );
outputFile.println ( "module " + strNamePackage + " {" );
countModules++;
}
if (! language.equals( UMLElement.CPP )){
outputFile.println ( "module idl { " );
countModules++;
}
outputFile.println ( "" );
outputFile.println ( "#ifndef " + idlFileName + "_idl" );
outputFile.println ( "#define " + idlFileName + "_idl" );
outputFile.println ( "" );
outputFile.println ( "interface " + idlFileName + ";");
Enumeration files = getIncludeFiles().elements();
while ( files.hasMoreElements()){
String fileName = (String) files.nextElement();
if (! idlFileName.equals( fileName ))
outputFile.println ( "#include " + "\"" + fileName + ".idl" + "\"" );
}
outputFile.println ( "" );
outputFile.println ( "// ---------------------------------------- " );
outputFile.println ( "" );
outputFile.println ( "// ---------------------------------------- " );
outputFile.println ( "" );
outputFile.print ( " interface " + idlFileName );
if (! extences.equals("")) outputFile.print ( " : " + extences );
outputFile.println ( " {" );
|
public java.lang.String | getArrayDeclaration(int countElements, java.lang.String typeDeclaration, java.lang.String memberName)
String type = "type_" + memberName;
String arrayDeclaration = ( countElements > 0 ) ?
(" typedef " + typeDeclaration + " " + type + "[" + countElements + "];" ):
(" typedef sequence<" + typeDeclaration + "> " + type + ";");
types.append( EOL );
types.append( arrayDeclaration );
return type;
|
public java.lang.String | getAttributeTitle()
return attribute;
|
public java.lang.String | getConvertedCppType(java.lang.String type)
return (String) cppToIdlTable.get( type );
|
public java.lang.String | getDelimiters()
return delimiters;
|
public java.lang.String | getIdlType()
if (convertedType == null) return "";
else return convertedType;
|
public java.util.Hashtable | getIncludeFiles()
return includeFiles;
|
public java.util.Hashtable | getJavaToIdlTable()
includeFiles = new Hashtable();
types = new StringBuffer();
Hashtable Javahashtable = new Hashtable();
for ( int i=0; i < javaAndIdlTypes.length; i++ ){
Javahashtable.put( javaAndIdlTypes[i][0], javaAndIdlTypes[i][1]);
}
return Javahashtable;
|
public java.lang.String | getMenuItem()
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
return "IDL for CORBA...";
|
public java.lang.String | getOperationDeclaration(java.lang.String type, java.lang.String name, java.lang.String parameters, java.lang.String exception)
return (type +" "+ name +"("+ parameters +")"+ exception +";" );
|
public java.lang.String | getParameterModificator(java.lang.String parameter, java.lang.String memberType, boolean arrayAttribute)
String parameterModificator = "";
if ( parameter.startsWith( prefixInOut )){
parameterModificator = in_out_parameter;
}
else if ( parameter.startsWith( prefixIn )){
parameterModificator = in_parameter;
}
else if ( parameter.startsWith( prefixOut )){
parameterModificator = out_parameter;
}
else {
if ((memberType.indexOf("&") >= 0) || (memberType.indexOf("*") >= 0)) {
parameterModificator = in_out_parameter;
}
else {
parameterModificator = in_parameter;
}
}
return parameterModificator;
|
public boolean | isCorrectType()
return currentType;
|
public void | putIdlFile(java.lang.String idlFile)
idlFile.trim();
idlFiles.put( idlFile, idlFile );
|
public void | putIncludeFile(java.lang.String includeFile)
if ( includeFile.endsWith( idlBaseFunctionality.postfix )){
int position = includeFile.lastIndexOf( idlBaseFunctionality.postfix );
String strIDLName = includeFile.substring(0,position);
includeFiles.put( strIDLName, strIDLName );
}
else{
setCorrectType( false );
apiManager.createMessage("IDL","Type of "+ includeFile +" is unknown.","");
}
|
public void | setCorrectType(boolean state)
currentType = state;
|
public void | setPackages(java.lang.String packages)
fullQualifiedName = packages;
|