Examples of ImmutableMessage


Examples of com.subhajit.diagram.sequencediagram.model.ImmutableMessage

            CommonUtils
                .getClassNameSansPackage(destInvokeInstruction
                    .getInvokedClass())
                + "."
                + destInvokeInstruction.getInvokedMethod());
        model.addMessage(new ImmutableMessage(srcActor, destActor,
            generateSequenceDiagramMessage(destInvokeInstruction),
            destInvokeInstruction.getInvokedMethodReturnType()));

        // Experimentally, at this point, add a sequence diagram model
        // for the destActor's invoked method.
        if (followMethodCalls) {
          sLog.fine(" method calls");
          try {
            MethodInfo destMethod = new MethodInfo(
                invokedClassName, destInvokeInstruction
                    .getInvokedMethod(),
                Utility.methodSignatureArgumentTypes(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false),
                Utility.methodSignatureReturnType(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false), null);

            if (!methodStack.contains(destMethod)) {
              // methodStack.add(destMethod);

              sLog.info("Following - "
                  + destMethod.getClassName() + "."
                  + destMethod.getMethodName());

              SequenceDiagramContext ctx2 = new SequenceDiagramContext();
              ctx2.setClassInfo(new ClassInfo(invokedClassName,
                  getClassLoader()));
              ctx2.setFilters(ctx.getFilters());
              ctx2.setFollowInvokedMethods(ctx
                  .getFollowInvokedMethods());
              ctx2.setMethodInfo(destMethod);
              ctx2.setShowInstructions(ctx.getShowInstructions());
              ctx2.setShowSourceLines(ctx.getShowSourceLines());
              ctx2.setSourceCodeManager(ctx
                  .getSourceCodeManager());
              SequenceDiagramModel destActorInvocationModel = generateSequenceDiagramModel(
                  ctx2, methodStack);
              if (destActorInvocationModel != null) {
                model.merge(destActorInvocationModel);
              }
            }
          } catch (NoSuchMethodException exc) {
            sLog.warning(exc.getMessage());
          }
        } else {
          sLog.fine("Not following method calls");
        }
      } else if (line instanceof PutfieldInstruction) {
        if (showPutFieldInstructions) {
          sLog.fine("PutfieldInstruction - " + line.toString());
          PutfieldInstruction putFieldInstruction = (PutfieldInstruction) line;
          final String invokedClassName = putFieldInstruction
              .getInvokedClass();

          // Check if this is a class of interest.
          if (filters != null) {
            if (!checkPackageMatch(filters, invokedClassName)) {
              sLog
                  .fine("Returning, since this class is not interesting.");
              continue;
            }
          }

          final ImmutableActor destActor = srcActor;
          model
              .addMessage(new ImmutableMessage(
                  srcActor,
                  destActor,
                  generateSequenceDiagramMessage(putFieldInstruction)));
        }
      } else if (line instanceof GetfieldInstruction) {
        if (showGetFieldInstructions) {
          sLog.fine("GetfieldInstruction - " + line.toString());
          GetfieldInstruction getFieldInstruction = (GetfieldInstruction) line;
          final String invokedClassName = getFieldInstruction
              .getInvokedClass();

          // Check if this is a class of interest.
          if (filters != null) {
            if (!checkPackageMatch(filters, invokedClassName)) {
              sLog
                  .fine("Returning, since this class is not interesting.");
              continue;
            }
          }

          final ImmutableActor destActor = srcActor;
          model
              .addMessage(new ImmutableMessage(
                  srcActor,
                  destActor,
                  generateSequenceDiagramMessage(getFieldInstruction)));
        }
      } else {
        // This instruction is not a method call.
        sLog.fine("Non-method call - " + line.toString());

        if (ctx.getShowInstructions() && ctx.getShowSourceLines()) {
          if (lineNumbers != null
              && ctx.getSourceCodeManager() != null) {
            showSourceLine(sourceLinesShown, model, srcActor,
                lineNumbers, line, classInfo.getJavaClass(),
                ctx.getSourceCodeManager());
          } else {
            model.addMessage(new ImmutableMessage(srcActor,
                srcActor, line.toString().replace(':', '_')));
          }
        } else if (ctx.getShowInstructions()
            && !ctx.getShowSourceLines()) {
          model.addMessage(new ImmutableMessage(srcActor, srcActor,
              line.toString().replace(':', '_')));
        } else if (!ctx.getShowInstructions()
            && ctx.getShowSourceLines()) {
          if (lineNumbers != null
              && ctx.getSourceCodeManager() != null) {
View Full Code Here

Examples of com.subhajit.diagram.sequencediagram.model.ImmutableMessage

              final String sourceLine = sourceCodeManager
                  .getSourceCode(javaClass.getClassName())
                  .get(zeroBasedLineNumber);
              if (sourceLine != null) {
                model
                    .addMessage(new ImmutableMessage(
                        srcActor, srcActor, sourceLine
                            .replace(':', '|')));
              }
            }
            sourceLinesShown.add(lineNumber);
View Full Code Here

Examples of com.subhajit.diagram.sequencediagram.model.ImmutableMessage

            CommonUtils
                .getClassNameSansPackage(destInvokeInstruction
                    .getInvokedClass())
                + "."
                + destInvokeInstruction.getInvokedMethod());
        model.addMessage(new ImmutableMessage(srcActor, destActor,
            generateSequenceDiagramMessage(destInvokeInstruction),
            destInvokeInstruction.getInvokedMethodReturnType()));

        // Experimentally, at this point, add a sequence diagram model
        // for the destActor's invoked method.
        if (followInvokedMethods) {
          try {
            MethodInfo destMethod = new MethodInfo(
                invokedClassName, destInvokeInstruction
                    .getInvokedMethod(),
                Utility.methodSignatureArgumentTypes(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false),
                Utility.methodSignatureReturnType(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false), null);

            if (!methodStack.contains(destMethod)) {
              // methodStack.add(destMethod);

              sLog.info("Following - "
                  + destMethod.getClassName() + "."
                  + destMethod.getMethodName());

              SequenceDiagramModel destActorInvocationModel = generateSequenceDiagramModel(
                  destMethod.getClassName(), destMethod,
                  methodStack, followInvokedMethods,
                  showInstructions, showSourceCode,
                  srcCodeManager, filters);
              if (destActorInvocationModel != null) {
                model.merge(destActorInvocationModel);
              }
            }
          } catch (NoSuchMethodException exc) {
            sLog.warning(exc.getMessage());
          }
        }
      } else if (line instanceof PutfieldInstruction) {
        if (showPutFieldInstructions) {
          sLog.fine("PutfieldInstruction - " + line.toString());
          PutfieldInstruction putFieldInstruction = (PutfieldInstruction) line;
          final String invokedClassName = putFieldInstruction
              .getInvokedClass();

          // Check if this is a class of interest.
          if (filters != null) {
            if (!checkPackageMatch(filters, invokedClassName)) {
              sLog
                  .fine("Returning, since this class is not interesting.");
              continue;
            }
          }

          final ImmutableActor destActor = srcActor;
          model
              .addMessage(new ImmutableMessage(
                  srcActor,
                  destActor,
                  generateSequenceDiagramMessage(putFieldInstruction)));
        }
      } else if (line instanceof GetfieldInstruction) {
        if (showGetFieldInstructions) {
          sLog.fine("GetfieldInstruction - " + line.toString());
          GetfieldInstruction getFieldInstruction = (GetfieldInstruction) line;
          final String invokedClassName = getFieldInstruction
              .getInvokedClass();

          // Check if this is a class of interest.
          if (filters != null) {
            if (!checkPackageMatch(filters, invokedClassName)) {
              sLog
                  .fine("Returning, since this class is not interesting.");
              continue;
            }
          }

          final ImmutableActor destActor = srcActor;
          model
              .addMessage(new ImmutableMessage(
                  srcActor,
                  destActor,
                  generateSequenceDiagramMessage(getFieldInstruction)));
        }
      } else {
        if (showInstructions && showSourceCode) {
          if (lineNumbers != null && srcCodeManager != null) {
            showSourceLine(sourceLinesShown, model, srcActor,
                lineNumbers, line, className, srcCodeManager);
          } else {
            model.addMessage(new ImmutableMessage(srcActor,
                srcActor, line.toString().replace(':', '_')));
          }
        } else if (showInstructions && !showSourceCode) {
          model.addMessage(new ImmutableMessage(srcActor, srcActor,
              line.toString().replace(':', '_')));
        } else if (!showInstructions && showSourceCode) {
          if (lineNumbers != null && srcCodeManager != null) {
            showSourceLine(sourceLinesShown, model, srcActor,
                lineNumbers, line, className, srcCodeManager);
View Full Code Here

Examples of com.subhajit.diagram.sequencediagram.model.ImmutableMessage

              final String sourceLine = sourceCodeManager
                  .getSourceCode(className).get(
                      zeroBasedLineNumber);
              if (sourceLine != null) {
                model
                    .addMessage(new ImmutableMessage(
                        srcActor, srcActor, sourceLine
                            .replace(':', '|')));
              }
            }
            sourceLinesShown.add(lineNumber);
View Full Code Here

Examples of com.subhajit.diagram.sequencediagram.model.ImmutableMessage

            CommonUtils
                .getClassNameSansPackage(destInvokeInstruction
                    .getInvokedClass())
                + "."
                + destInvokeInstruction.getInvokedMethod());
        model.addMessage(new ImmutableMessage(srcActor, destActor,
            generateSequenceDiagramMessage(destInvokeInstruction),
            destInvokeInstruction.getInvokedMethodReturnType()));

        // Experimentally, at this point, add a sequence diagram model
        // for the destActor's invoked method.
        if (followInvokedMethods) {
          try {
            MethodInfo destMethod = new MethodInfo(
                invokedClassName, destInvokeInstruction
                    .getInvokedMethod(),
                Utility.methodSignatureArgumentTypes(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false),
                Utility.methodSignatureReturnType(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false), null);

            if (!methodStack.contains(destMethod)) {
              // methodStack.add(destMethod);

              sLog.info("Following - "
                  + destMethod.getClassName() + "."
                  + destMethod.getMethodName());

              SequenceDiagramModel destActorInvocationModel = generateSequenceDiagramModel(
                  destMethod.getClassName(), destMethod,
                  methodStack, followInvokedMethods,
                  showInstructions, showSourceCode,
                  srcCodeManager, filters);
              if (destActorInvocationModel != null) {
                model.merge(destActorInvocationModel);
              }
            }
          } catch (NoSuchMethodException exc) {
            sLog.warning(exc.getMessage());
          }
        }
      } else if (line instanceof PutfieldInstruction) {
        if (showPutFieldInstructions) {
          sLog.fine("PutfieldInstruction - " + line.toString());
          PutfieldInstruction putFieldInstruction = (PutfieldInstruction) line;
          final String invokedClassName = putFieldInstruction
              .getInvokedClass();

          // Check if this is a class of interest.
          if (filters != null) {
            if (!checkPackageMatch(filters, invokedClassName)) {
              sLog
                  .fine("Returning, since this class is not interesting.");
              continue;
            }
          }

          final ImmutableActor destActor = srcActor;
          model
              .addMessage(new ImmutableMessage(
                  srcActor,
                  destActor,
                  generateSequenceDiagramMessage(putFieldInstruction)));
        }
      } else if (line instanceof GetfieldInstruction) {
        if (showGetFieldInstructions) {
          sLog.fine("GetfieldInstruction - " + line.toString());
          GetfieldInstruction getFieldInstruction = (GetfieldInstruction) line;
          final String invokedClassName = getFieldInstruction
              .getInvokedClass();

          // Check if this is a class of interest.
          if (filters != null) {
            if (!checkPackageMatch(filters, invokedClassName)) {
              sLog
                  .fine("Returning, since this class is not interesting.");
              continue;
            }
          }

          final ImmutableActor destActor = srcActor;
          model
              .addMessage(new ImmutableMessage(
                  srcActor,
                  destActor,
                  generateSequenceDiagramMessage(getFieldInstruction)));
        }
      } else {
        if (showInstructions && showSourceCode) {
          if (lineNumbers != null && srcCodeManager != null) {
            showSourceLine(sourceLinesShown, model, srcActor,
                lineNumbers, line, className, srcCodeManager);
          } else {
            model.addMessage(new ImmutableMessage(srcActor,
                srcActor, line.toString().replace(':', '_')));
          }
        } else if (showInstructions && !showSourceCode) {
          model.addMessage(new ImmutableMessage(srcActor, srcActor,
              line.toString().replace(':', '_')));
        } else if (!showInstructions && showSourceCode) {
          if (lineNumbers != null && srcCodeManager != null) {
            showSourceLine(sourceLinesShown, model, srcActor,
                lineNumbers, line, className, srcCodeManager);
View Full Code Here

Examples of com.subhajit.diagram.sequencediagram.model.ImmutableMessage

              final String sourceLine = sourceCodeManager
                  .getSourceCode(className).get(
                      zeroBasedLineNumber);
              if (sourceLine != null) {
                model
                    .addMessage(new ImmutableMessage(
                        srcActor, srcActor, sourceLine
                            .replace(':', '|')));
              }
            }
            sourceLinesShown.add(lineNumber);
View Full Code Here

Examples of com.subhajit.diagram.sequencediagram.model.ImmutableMessage

            CommonUtils
                .getClassNameSansPackage(destInvokeInstruction
                    .getInvokedClass())
                + "."
                + destInvokeInstruction.getInvokedMethod());
        model.addMessage(new ImmutableMessage(srcActor, destActor,
            generateSequenceDiagramMessage(destInvokeInstruction),
            destInvokeInstruction.getInvokedMethodReturnType()));

        // Experimentally, at this point, add a sequence diagram model
        // for the destActor's invoked method.
        if (followMethodCalls) {
          sLog.fine(" method calls");
          try {
            MethodInfo destMethod = new MethodInfo(
                invokedClassName, destInvokeInstruction
                    .getInvokedMethod(),
                Utility.methodSignatureArgumentTypes(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false),
                Utility.methodSignatureReturnType(
                    destInvokeInstruction
                        .getInvokedMethodSignature(),
                    false), null);

            if (!methodStack.contains(destMethod)) {
              // methodStack.add(destMethod);

              sLog.info("Following - "
                  + destMethod.getClassName() + "."
                  + destMethod.getMethodName());

              SequenceDiagramContext ctx2 = new SequenceDiagramContext();
              ctx2.setClassInfo(new ClassInfo(invokedClassName,
                  getClassLoader()));
              ctx2.setFilters(ctx.getFilters());
              ctx2.setFollowInvokedMethods(ctx
                  .getFollowInvokedMethods());
              ctx2.setMethodInfo(destMethod);
              ctx2.setShowInstructions(ctx.getShowInstructions());
              ctx2.setShowSourceLines(ctx.getShowSourceLines());
              ctx2.setSourceCodeManager(ctx
                  .getSourceCodeManager());
              SequenceDiagramModel destActorInvocationModel = generateSequenceDiagramModel(
                  ctx2, methodStack);
              if (destActorInvocationModel != null) {
                model.merge(destActorInvocationModel);
              }
            }
          } catch (NoSuchMethodException exc) {
            sLog.warning(exc.getMessage());
          }
        } else {
          sLog.fine("Not following method calls");
        }
      } else if (line instanceof PutfieldInstruction) {
        if (showPutFieldInstructions) {
          sLog.fine("PutfieldInstruction - " + line.toString());
          PutfieldInstruction putFieldInstruction = (PutfieldInstruction) line;
          final String invokedClassName = putFieldInstruction
              .getInvokedClass();

          // Check if this is a class of interest.
          if (filters != null) {
            if (!checkPackageMatch(filters, invokedClassName)) {
              sLog
                  .fine("Returning, since this class is not interesting.");
              continue;
            }
          }

          final ImmutableActor destActor = srcActor;
          model
              .addMessage(new ImmutableMessage(
                  srcActor,
                  destActor,
                  generateSequenceDiagramMessage(putFieldInstruction)));
        }
      } else if (line instanceof GetfieldInstruction) {
        if (showGetFieldInstructions) {
          sLog.fine("GetfieldInstruction - " + line.toString());
          GetfieldInstruction getFieldInstruction = (GetfieldInstruction) line;
          final String invokedClassName = getFieldInstruction
              .getInvokedClass();

          // Check if this is a class of interest.
          if (filters != null) {
            if (!checkPackageMatch(filters, invokedClassName)) {
              sLog
                  .fine("Returning, since this class is not interesting.");
              continue;
            }
          }

          final ImmutableActor destActor = srcActor;
          model
              .addMessage(new ImmutableMessage(
                  srcActor,
                  destActor,
                  generateSequenceDiagramMessage(getFieldInstruction)));
        }
      } else {
        // This instruction is not a method call.
        sLog.fine("Non-method call - " + line.toString());

        if (ctx.getShowInstructions() && ctx.getShowSourceLines()) {
          if (lineNumbers != null
              && ctx.getSourceCodeManager() != null) {
            showSourceLine(sourceLinesShown, model, srcActor,
                lineNumbers, line, classInfo.getJavaClass(),
                ctx.getSourceCodeManager());
          } else {
            model.addMessage(new ImmutableMessage(srcActor,
                srcActor, line.toString().replace(':', '_')));
          }
        } else if (ctx.getShowInstructions()
            && !ctx.getShowSourceLines()) {
          model.addMessage(new ImmutableMessage(srcActor, srcActor,
              line.toString().replace(':', '_')));
        } else if (!ctx.getShowInstructions()
            && ctx.getShowSourceLines()) {
          if (lineNumbers != null
              && ctx.getSourceCodeManager() != null) {
View Full Code Here

Examples of com.subhajit.diagram.sequencediagram.model.ImmutableMessage

              final String sourceLine = sourceCodeManager
                  .getSourceCode(javaClass.getClassName())
                  .get(zeroBasedLineNumber);
              if (sourceLine != null) {
                model
                    .addMessage(new ImmutableMessage(
                        srcActor, srcActor, sourceLine
                            .replace(':', '|')));
              }
            }
            sourceLinesShown.add(lineNumber);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.