Package org.aspectj.bridge

Examples of org.aspectj.bridge.Message


      location = new SourceLocation(config.getConfigFile(), 0);
    }

    String message = parser.getOtherMessages(true);
    if (null != message) {
      IMessage m = new Message(message, IMessage.ERROR, null, location);
      handler.handleMessage(m);
    }

    // always force model generation in AJDE
    config.setGenerateModelMode(true);
View Full Code Here


    }

    String description = advice.getKind().toString();
    String advisedType = shadow.getEnclosingType().getName();
    String advisingType = advice.getConcreteAspect().getName();
    Message msg = null;
    if (advice.getKind().equals(AdviceKind.Softener)) {
      msg = WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_SOFTENS, new String[] { advisedType,
          beautifyLocation(shadow.getSourceLocation()), advisingType, beautifyLocation(munger.getSourceLocation()) },
          advisedType, advisingType);
    } else {
View Full Code Here

    return bcelWeavingSupport;
  }

  @Override
  public void reportCheckerMatch(Checker checker, Shadow shadow) {
    IMessage iMessage = new Message(checker.getMessage(shadow), shadow.toString(), checker.isError() ? IMessage.ERROR
        : IMessage.WARNING, shadow.getSourceLocation(), null, new ISourceLocation[] { checker.getSourceLocation() }, true,
        0, -1, -1);

    getMessageHandler().handleMessage(iMessage);
View Full Code Here

     */
    public List readConfigFile(String filePath) {
        try {
            File configFile = new File(filePath);
            if (!configFile.exists()) {
              Message msg = new Message("Config file: " + filePath +
                        " does not exist.  Update failed.",IMessage.WARNING,null,null);
              Ajde.getDefault().getMessageHandler().handleMessage(msg);
            }
            List fileContents = new ArrayList();
            BufferedReader reader = new BufferedReader(new FileReader(configFile));
            String line = reader.readLine();
            while (line != null) {
                fileContents.add(line.replace('\\', '/'));
                line = reader.readLine();
            }
            reader.close();
            return fileContents;
        } catch (IOException ioe) {
          Message msg = new Message("Could not update build config file.",IMessage.ERROR,ioe,null);
          Ajde.getDefault().getMessageHandler().handleMessage(msg);
        }
        return null;
    }
View Full Code Here

      FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(filePath, false);
            fos.write(contents.getBytes());
        } catch (IOException ioe) {
          Message msg = new Message("Could not update build config file: " + filePath,IMessage.ERROR,ioe,null);
          Ajde.getDefault().getMessageHandler().handleMessage(msg);
        } finally {
          if (fos!=null) try {fos.close();} catch (IOException ioe) {}
        }
    }
View Full Code Here

          importedFiles = configParser.getImportedFiles();
          badEntries = configParser.getProblemEntries();
    } catch (ConfigParser.ParseException pe) {
//      String filePath = "<unknown>";
//      if (pe.getFile() != null) filePath = pe.getFile().getAbsolutePath();
            IMessage message = new Message(
                pe.getMessage(),
                IMessage.ERROR,
                pe,
                new SourceLocation(pe.getFile(), pe.getLine(), 1));
            Ajde.getDefault().getMessageHandler().handleMessage(message);
View Full Code Here

      }
      holder.handleMessage(MessageUtil.info("Compiler took " + (etime - stime) + "ms"));
      // uncomment next line to pause at end (keeps jconsole alive!)
      // try { System.in.read(); } catch (Exception e) {}
    } catch (OutOfMemoryError outOfMemory) {
      IMessage outOfMemoryMessage = new Message(OUT_OF_MEMORY_MSG, null, true);
      holder.handleMessage(outOfMemoryMessage);
      systemExit(holder); // we can't reasonably continue from this point.
    } finally {
      CompilationAndWeavingContext.reset();
      Dump.reset();
View Full Code Here

    return result;
  }

  /** convenience API to make fail messages (without MessageUtils's fail prefix) */
  protected static void fail(IMessageHandler handler, String message, Throwable thrown) {
    handler.handleMessage(new Message(message, IMessage.FAIL, thrown, null));
  }
View Full Code Here

    }
    return true;
  }

  public void error(BcelClassWeaver weaver, String text, ISourceLocation primaryLoc, ISourceLocation[] extraLocs) {
    IMessage msg = new Message(text, primaryLoc, true, extraLocs);
    weaver.getWorld().getMessageHandler().handleMessage(msg);
  }
View Full Code Here

          }
        }
        if (!isOK) {
          // the class does not implement this method, they needed to
          // supply a default impl class
          IMessage msg = new Message("@DeclareParents: No defaultImpl was specified but the type '" + gen.getName()
              + "' does not implement the method '" + stringifyMember(introduced) + "' defined on the interface '"
              + introduced.getDeclaringType() + "'", weaver.getLazyClassGen().getType().getSourceLocation(), true,
              new ISourceLocation[] { munger.getSourceLocation() });
          weaver.getWorld().getMessageHandler().handleMessage(msg);
          return false;
View Full Code Here

TOP

Related Classes of org.aspectj.bridge.Message

Copyright © 2018 www.massapicom. 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.