Methods Summary |
---|
private void | addComponentToOutputBuf(java.lang.String strComponentType, java.lang.String strComponentName)
if (! strComponentType.equals("") ) strBuff.append( strComponentType );
if (! strComponentName.equals("") ) strBuff.append( strComponentName );
addLine();
|
private void | addLine()
strBuff.append( strEOL );
|
private void | attributesProcessing(UMLAttributeEnumeration umlAttributeEnumeration)
int iCountAttributes = 0;
while( umlAttributeEnumeration.hasMoreElements() ){
UMLAttribute umlAttribute = umlAttributeEnumeration.getNextUMLAttribute();
iCountAttributes ++;
}
// write couunt attributes to output buffer
String strCount = "" + iCountAttributes;
addComponentToOutputBuf( " Number of attributes : ", strCount );
|
private void | classDiagramContentsProcessing(UMLPackage umlPackage)
// classes processing
UMLClassEnumeration umlClassEnum = ((UMLClassDiagram)(umlPackage)).getClasses();
addLine();
addLine();
addComponentToOutputBuf( "", umlPackage.toLongString() );
if ( umlClassEnum.hasMoreElements() ) {
addComponentToOutputBuf( "CLASSES :","");
addLine();
}
while( umlClassEnum.hasMoreElements() ){
UMLClassifier umlClassifier = (UMLClassifier) umlClassEnum.getNextUMLClass();
classifierProcessing( umlClassifier );
}
// interfaces processing
UMLInterfaceEnumeration umlInterfaceEnum = ((UMLClassDiagram)(umlPackage)).getInterfaces();
if ( umlInterfaceEnum.hasMoreElements() ) {
addLine();
addComponentToOutputBuf( "INTERFACES :","");
}
while( umlInterfaceEnum.hasMoreElements() ){
UMLClassifier umlClassifier = (UMLClassifier) umlInterfaceEnum.getNextUMLInterface();
classifierProcessing( umlClassifier );
}
|
private void | classifierProcessing(UMLClassifier umlClassifier)
addComponentToOutputBuf( " ",umlClassifier.getName());
// operations processing
UMLOperationEnumeration umlOperationEnumeration = umlClassifier.getOperations();
operationsProcessing( umlOperationEnumeration );
// attributes processing
UMLAttributeEnumeration umlAttributeEnumeration = umlClassifier.getAttributes();
attributesProcessing( umlAttributeEnumeration );
|
public void | doIt(APIManager apiManager)
umlRootPackage = apiManager.getUMLModel().getRootPackage();
if ( umlRootPackage == null ){
apiManager.createMessage("CountMembers", "Root package is null ", "Error");
return;
}
try{
String outputStreamName = apiManager.getOutputStream(".txt");
if (outputStreamName != null){
txtFileCreater( outputStreamName );
modelProcessing( umlRootPackage );
txtFileClose();
apiManager.openExternalViewer(outputStreamName);
System.out.println( "Done" );
}
}
catch( Exception e ){
e.printStackTrace();
}
|
public java.lang.String | getMenuItem()
//------------------------------------------------------------------------------
return "CountMembers...|T";
|
private void | modelProcessing(UMLPackage umlPackage)
classDiagramContentsProcessing( umlPackage );
UMLClassDiagramEnumeration classDiagrams = umlPackage.getClassDiagrams();
while ( classDiagrams.hasMoreElements()){
UMLPackage umlNextPackage = classDiagrams.getNextUMLClassDiagram();
modelProcessing( umlNextPackage );
}
|
private void | operationsProcessing(UMLOperationEnumeration umlOperationEnumeration)
int iCountOperation = 0;
while( umlOperationEnumeration.hasMoreElements() ) {
UMLOperation umlOperation = umlOperationEnumeration.getNextUMLOperation();
iCountOperation ++;
}
// write couunt operations to output buffer
String strCount = "" + iCountOperation;
addComponentToOutputBuf( " Number of operations : ", strCount );
|
private void | txtFileClose()
String strDocumentation = new String( strBuff );
if (! strDocumentation.equals("")) outputFile.println( strDocumentation );
outputFile.println ( "" );
outputFile.println ( "---------- End of document ----------" );
outputFile.flush ();
outputFile.close ();
|
private void | txtFileCreater(java.lang.String strFullName)
try{
outputFile = new PrintWriter( new FileWriter( strFullName ));
outputFile.println ( " --------------------- " );
outputFile.println ( " Generated by Together " );
outputFile.println ( " --------------------- " );
}
catch (Exception e){
e.printStackTrace();
}
|