Package org.aspectj.ajdt.ajc
Class AjdtCommand
java.lang.Object
org.aspectj.ajdt.ajc.AjdtCommand
- All Implemented Interfaces:
ICommand
ICommand adapter for the AspectJ compiler.
Not thread-safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String
Message String for any AbortException thrown from ICommand API's -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doCommand(IMessageHandler handler, boolean repeat)
Delegate of both runCommand and repeatCommand.static AjBuildConfig
genBuildConfig(String[] args, CountingMessageHandler handler)
This creates a build configuration for the arguments.protected static IMessage.Kind
Heuristically infer the type of output message logged by the AspectJ compiler.boolean
repeatCommand(IMessageHandler handler)
Run AspectJ compiler, wrapping any exceptions thrown as ABORT messages (containing ABORT_MESSAGE String).boolean
runCommand(String[] args, IMessageHandler handler)
Run AspectJ compiler, wrapping any exceptions thrown as ABORT messages (containing ABORT_MESSAGE String).
-
Field Details
-
ABORT_MESSAGE
Message String for any AbortException thrown from ICommand API's- See Also:
- Constant Field Values
-
-
Constructor Details
-
AjdtCommand
public AjdtCommand()
-
-
Method Details
-
runCommand
Run AspectJ compiler, wrapping any exceptions thrown as ABORT messages (containing ABORT_MESSAGE String).- Specified by:
runCommand
in interfaceICommand
- Parameters:
args
- the String[] for the compilerhandler
- the IMessageHandler for any messages- Returns:
- false if handler has errors or the command failed
- See Also:
ICommand.runCommand(String[], IMessageHandler)
-
repeatCommand
Run AspectJ compiler, wrapping any exceptions thrown as ABORT messages (containing ABORT_MESSAGE String).- Specified by:
repeatCommand
in interfaceICommand
- Parameters:
handler
- the IMessageHandler for any messages- Returns:
- false if handler has errors or the command failed
- See Also:
ICommand.repeatCommand(IMessageHandler)
-
doCommand
Delegate of both runCommand and repeatCommand. This invokes the argument parser each time (even when repeating). If the parser detects errors, this signals an abort with the usage message and returns false.- Parameters:
handler
- the IMessageHandler sink for any messagesrepeat
- if true, do incremental build, else do batch build- Returns:
- false if handler has any errors or command failed
-
genBuildConfig
This creates a build configuration for the arguments. Errors reported to the handler:- The parser detects some directly
- The parser grabs some from the error stream emitted by its superclass
- The configuration has a self-test
-
inferKind
Heuristically infer the type of output message logged by the AspectJ compiler. This is a simple keyword matcher looking for substrings like "[error]", "[warning]", "AspectJ-specific options:", "AspectJ-specific non-standard options:", "Warning options:".- Parameters:
message
- AspectJ compiler message- Returns:
- inferred message kind, either of ERROR, WARNING, USAGE, INFO
-