Class AtomParser
- java.lang.Object
-
- org.sonatype.maven.polyglot.atom.parsing.AtomParser
-
public class AtomParser extends java.lang.ObjectParses the atom token stream into an internal model, which can be emitted as a Maven model.
-
-
Field Summary
Fields Modifier and Type Field Description private intiprivate java.util.logging.Loggerlogprivate org.apache.maven.model.building.ModelSourcemodelSourceprivate java.util.List<Token>tokens
-
Constructor Summary
Constructors Constructor Description AtomParser(org.apache.maven.model.building.ModelSource modelSource, java.util.List<Token> tokens)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private TokenanyOf(Token.Kind... ident)private voidchewEols()private voidchewIndents()private java.lang.Stringclassifier()classifier := LPAREN IDENT RPARENprivate java.util.Map<java.lang.String,java.lang.Object>configurationMap()private java.util.List<Id>dependencies(Token.Kind kind, boolean allowNullVersion)Dependencies of a project.private Idid()Id of a project definition.private Idid(boolean allowNullVersion)private java.lang.StringidFragment()private voidindent()private java.util.List<Token>match(Token.Kind... ident)private java.util.List<java.lang.String>modules()private org.apache.maven.model.Parentparent()Projectparse()private voidparseException(java.lang.String message)private voidparseException(java.lang.String message, java.lang.Throwable t)private org.apache.maven.model.Pluginplugin(Token.Kind keyword)private java.util.List<org.apache.maven.model.Plugin>plugins(Token.Kind keyword)Additional plugins and their configuration.private Projectproject(Repositories repositories)Parsing rule for a single project build definition.private java.util.List<Property>properties(Token.Kind kind)private Propertyproperty()private java.lang.StringrelativePath()private Repositoriesrepositories()Optional repositories declaration at the top of the file.private ScmElementscm()private java.util.Map<java.lang.String,java.lang.String>srcs()Custom directory structure for maven builds.(package private) static java.lang.StringstripQuotes(java.lang.String atom)private org.codehaus.plexus.util.xml.Xpp3DomtoXpp3DomTree(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> config)private java.lang.StringvalidateUrl(java.lang.String url)
-
-
-
Field Detail
-
log
private final java.util.logging.Logger log
-
tokens
private final java.util.List<Token> tokens
-
modelSource
private final org.apache.maven.model.building.ModelSource modelSource
-
i
private int i
-
-
Constructor Detail
-
AtomParser
public AtomParser(org.apache.maven.model.building.ModelSource modelSource, java.util.List<Token> tokens)
-
-
Method Detail
-
parseException
private void parseException(java.lang.String message, java.lang.Throwable t)
-
parseException
private void parseException(java.lang.String message)
-
parse
public Project parse()
-
project
private Project project(Repositories repositories)
Parsing rule for a single project build definition. project := 'project' STRING (AT URL)? ('as' PACKAGING)? EOL (idFragment COLON list EOL)+
-
scm
private ScmElement scm()
-
srcs
private java.util.Map<java.lang.String,java.lang.String> srcs()
Custom directory structure for maven builds.
-
dependencies
private java.util.List<Id> dependencies(Token.Kind kind, boolean allowNullVersion)
Dependencies of a project. The real meat of it.
-
plugins
private java.util.List<org.apache.maven.model.Plugin> plugins(Token.Kind keyword)
Additional plugins and their configuration.
-
plugin
private org.apache.maven.model.Plugin plugin(Token.Kind keyword)
-
toXpp3DomTree
private org.codehaus.plexus.util.xml.Xpp3Dom toXpp3DomTree(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> config)
-
configurationMap
private java.util.Map<java.lang.String,java.lang.Object> configurationMap()
-
stripQuotes
static java.lang.String stripQuotes(java.lang.String atom)
-
properties
private java.util.List<Property> properties(Token.Kind kind)
-
modules
private java.util.List<java.lang.String> modules()
-
classifier
private java.lang.String classifier()
classifier := LPAREN IDENT RPAREN
-
property
private Property property()
-
id
private Id id()
Id of a project definition. id := IDENT (DOT IDENT)* COLON IDENT (COLON IDENT)? EOL
-
id
private Id id(boolean allowNullVersion)
-
parent
private org.apache.maven.model.Parent parent()
-
relativePath
private java.lang.String relativePath()
-
idFragment
private java.lang.String idFragment()
-
repositories
private Repositories repositories()
Optional repositories declaration at the top of the file. repositories := 'repositories' LEFT_WAVE STRING (COMMA STRING)*
-
validateUrl
private java.lang.String validateUrl(java.lang.String url)
-
indent
private void indent()
-
anyOf
private Token anyOf(Token.Kind... ident)
-
match
private java.util.List<Token> match(Token.Kind... ident)
-
chewEols
private void chewEols()
-
chewIndents
private void chewIndents()
-
-