Package org.apache.maven.cling.invoker
Class BaseParser<O extends Options,R extends InvokerRequest<O>>
java.lang.Object
org.apache.maven.cling.invoker.BaseParser<O,R>
- All Implemented Interfaces:
Parser<R>
- Direct Known Subclasses:
BaseMavenParser
,DefaultEncryptParser
public abstract class BaseParser<O extends Options,R extends InvokerRequest<O>>
extends Object
implements Parser<R>
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract O
assembleOptions
(List<O> parsedOptions) protected Path
getCwd
(BaseParser.LocalContext context) protected Path
protected abstract R
getInvokerRequest
(BaseParser.LocalContext context) protected Path
getRootDirectory
(BaseParser.LocalContext context) protected Path
getTopDirectory
(BaseParser.LocalContext context) protected Path
parse
(ParserRequest parserRequest) Parses the given ParserRequest to create an InvokerRequest.parseCliOptions
(BaseParser.LocalContext context) protected List
<CoreExtension> protected List
<CoreExtension> readCoreExtensionsDescriptorFromFile
(Path extensionsFile)
-
Constructor Details
-
BaseParser
public BaseParser()
-
-
Method Details
-
parse
Description copied from interface:Parser
Parses the given ParserRequest to create an InvokerRequest. This method is responsible for interpreting the contents of the ParserRequest and constructing the appropriate InvokerRequest object.- Specified by:
parse
in interfaceParser<O extends Options>
- Parameters:
parserRequest
- the request containing all necessary information for parsing- Returns:
- the parsed InvokerRequest
- Throws:
ParserException
- if there's an error during parsing of the requestIOException
- if there's an I/O error during the parsing process
-
getInvokerRequest
-
getCwd
- Throws:
ParserException
-
getInstallationDirectory
- Throws:
ParserException
-
getUserHomeDirectory
- Throws:
ParserException
-
getTopDirectory
- Throws:
ParserException
-
getRootDirectory
- Throws:
ParserException
-
populateSystemProperties
protected Map<String,String> populateSystemProperties(BaseParser.LocalContext context) throws ParserException - Throws:
ParserException
-
populateUserProperties
protected Map<String,String> populateUserProperties(BaseParser.LocalContext context) throws ParserException, IOException - Throws:
ParserException
IOException
-
parseCliOptions
protected abstract List<O> parseCliOptions(BaseParser.LocalContext context) throws ParserException, IOException - Throws:
ParserException
IOException
-
assembleOptions
-
readCoreExtensionsDescriptor
protected List<CoreExtension> readCoreExtensionsDescriptor(BaseParser.LocalContext context) throws ParserException, IOException - Throws:
ParserException
IOException
-
readCoreExtensionsDescriptorFromFile
protected List<CoreExtension> readCoreExtensionsDescriptorFromFile(Path extensionsFile) throws ParserException, IOException - Throws:
ParserException
IOException
-