You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CompilerWrapper.java 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* *******************************************************************
  2. * Copyright (c) 2003 Contributors.
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * Mik Kersten initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.tools.ajdoc;
  13. import org.aspectj.asm.AsmManager;
  14. import org.aspectj.bridge.IMessage;
  15. /**
  16. * Wrapper for ajdoc's use of the AspectJ compiler.
  17. *
  18. * @author Mik Kersten
  19. */
  20. public class CompilerWrapper extends org.aspectj.tools.ajc.Main {
  21. private static CompilerWrapper INSTANCE = null;
  22. public static AsmManager executeMain(String[] args) {
  23. INSTANCE = new CompilerWrapper();
  24. INSTANCE.runMain(args, true);
  25. return AsmManager.lastActiveStructureModel;
  26. }
  27. public static boolean hasErrors() {
  28. return INSTANCE.ourHandler.getErrors().length > 0;
  29. }
  30. public static IMessage[] getErrors() {
  31. return INSTANCE.ourHandler.getErrors();
  32. }
  33. }