Package org.eclipse.tycho.pomless
Class AbstractTychoMapping
- java.lang.Object
-
- org.eclipse.tycho.pomless.AbstractTychoMapping
-
- All Implemented Interfaces:
org.apache.maven.model.io.ModelReader
,org.sonatype.maven.polyglot.mapping.Mapping
- Direct Known Subclasses:
AbstractXMLTychoMapping
,TychoAggregatorMapping
,TychoBundleMapping
public abstract class AbstractTychoMapping extends Object implements org.sonatype.maven.polyglot.mapping.Mapping, org.apache.maven.model.io.ModelReader
Base implementation for aMapping
andModelReader
that handles all the low-level stuff, implementations must only handle a small subset
-
-
Field Summary
Fields Modifier and Type Field Description protected org.codehaus.plexus.PlexusContainer
container
protected org.codehaus.plexus.logging.Logger
logger
-
Constructor Summary
Constructors Constructor Description AbstractTychoMapping()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
accept(Map<String,?> options)
protected org.apache.maven.model.Parent
findParent(File projectRoot, Map<String,?> projectOptions)
protected static Properties
getBuildProperties(File dir)
String
getFlavour()
protected abstract String
getPackaging()
protected static String
getPomVersion(String pdeVersion)
protected abstract File
getPrimaryArtifact(File dir)
protected Charset
getPrimaryArtifactCharset()
returns the charset that should be used when reading artifact, default is UTF-8 might be overridden by subclassesfloat
getPriority()
org.apache.maven.model.io.ModelReader
getReader()
protected File
getRealArtifactFile(File polyglotArtifactFile)
org.apache.maven.model.io.ModelWriter
getWriter()
protected abstract void
initModel(org.apache.maven.model.Model model, Reader artifactReader, File artifactFile)
protected abstract boolean
isValidLocation(String location)
File
locatePom(File dir)
protected PomReference
locatePomReference(File folder, String nameHint)
Locates thePomReference
for the given folder and the given nameHintorg.apache.maven.model.Model
read(File input, Map<String,?> options)
org.apache.maven.model.Model
read(InputStream input, Map<String,?> options)
org.apache.maven.model.Model
read(Reader input, Map<String,?> options)
-
-
-
Method Detail
-
locatePom
public File locatePom(File dir)
- Specified by:
locatePom
in interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
accept
public boolean accept(Map<String,?> options)
- Specified by:
accept
in interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
getReader
public org.apache.maven.model.io.ModelReader getReader()
- Specified by:
getReader
in interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
getWriter
public org.apache.maven.model.io.ModelWriter getWriter()
- Specified by:
getWriter
in interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
read
public org.apache.maven.model.Model read(InputStream input, Map<String,?> options) throws IOException, org.apache.maven.model.io.ModelParseException
- Specified by:
read
in interfaceorg.apache.maven.model.io.ModelReader
- Throws:
IOException
org.apache.maven.model.io.ModelParseException
-
read
public org.apache.maven.model.Model read(File input, Map<String,?> options) throws IOException, org.apache.maven.model.io.ModelParseException
- Specified by:
read
in interfaceorg.apache.maven.model.io.ModelReader
- Throws:
IOException
org.apache.maven.model.io.ModelParseException
-
read
public org.apache.maven.model.Model read(Reader input, Map<String,?> options) throws IOException, org.apache.maven.model.io.ModelParseException
- Specified by:
read
in interfaceorg.apache.maven.model.io.ModelReader
- Throws:
IOException
org.apache.maven.model.io.ModelParseException
-
findParent
protected org.apache.maven.model.Parent findParent(File projectRoot, Map<String,?> projectOptions) throws org.apache.maven.model.io.ModelParseException, IOException
- Throws:
org.apache.maven.model.io.ModelParseException
IOException
-
locatePomReference
protected PomReference locatePomReference(File folder, String nameHint)
Locates thePomReference
for the given folder and the given nameHint- Parameters:
folder
- the folder to searchnameHint
- the name hint to use- Returns:
- the
PomReference
ornull
-
getPriority
public float getPriority()
- Specified by:
getPriority
in interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
getFlavour
public String getFlavour()
- Specified by:
getFlavour
in interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
isValidLocation
protected abstract boolean isValidLocation(String location)
-
getPackaging
protected abstract String getPackaging()
-
getPrimaryArtifactCharset
protected Charset getPrimaryArtifactCharset()
returns the charset that should be used when reading artifact, default is UTF-8 might be overridden by subclasses- Returns:
- the charset
-
initModel
protected abstract void initModel(org.apache.maven.model.Model model, Reader artifactReader, File artifactFile) throws org.apache.maven.model.io.ModelParseException, IOException
- Throws:
org.apache.maven.model.io.ModelParseException
IOException
-
getBuildProperties
protected static Properties getBuildProperties(File dir) throws IOException
- Throws:
IOException
-
-