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 aMappingandModelReaderthat 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.PlexusContainercontainerprotected org.codehaus.plexus.logging.Loggerlogger
-
Constructor Summary
Constructors Constructor Description AbstractTychoMapping()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaccept(Map<String,?> options)protected org.apache.maven.model.ParentfindParent(File projectRoot, Map<String,?> projectOptions)protected static PropertiesgetBuildProperties(File dir)StringgetFlavour()protected abstract StringgetPackaging()protected static StringgetPomVersion(String pdeVersion)protected abstract FilegetPrimaryArtifact(File dir)protected CharsetgetPrimaryArtifactCharset()returns the charset that should be used when reading artifact, default is UTF-8 might be overridden by subclassesfloatgetPriority()org.apache.maven.model.io.ModelReadergetReader()protected FilegetRealArtifactFile(File polyglotArtifactFile)org.apache.maven.model.io.ModelWritergetWriter()protected abstract voidinitModel(org.apache.maven.model.Model model, Reader artifactReader, File artifactFile)protected abstract booleanisValidLocation(String location)FilelocatePom(File dir)protected PomReferencelocatePomReference(File folder, String nameHint)Locates thePomReferencefor the given folder and the given nameHintorg.apache.maven.model.Modelread(File input, Map<String,?> options)org.apache.maven.model.Modelread(InputStream input, Map<String,?> options)org.apache.maven.model.Modelread(Reader input, Map<String,?> options)
-
-
-
Method Detail
-
locatePom
public File locatePom(File dir)
- Specified by:
locatePomin interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
accept
public boolean accept(Map<String,?> options)
- Specified by:
acceptin interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
getReader
public org.apache.maven.model.io.ModelReader getReader()
- Specified by:
getReaderin interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
getWriter
public org.apache.maven.model.io.ModelWriter getWriter()
- Specified by:
getWriterin 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:
readin interfaceorg.apache.maven.model.io.ModelReader- Throws:
IOExceptionorg.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:
readin interfaceorg.apache.maven.model.io.ModelReader- Throws:
IOExceptionorg.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:
readin interfaceorg.apache.maven.model.io.ModelReader- Throws:
IOExceptionorg.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.ModelParseExceptionIOException
-
locatePomReference
protected PomReference locatePomReference(File folder, String nameHint)
Locates thePomReferencefor the given folder and the given nameHint- Parameters:
folder- the folder to searchnameHint- the name hint to use- Returns:
- the
PomReferenceornull
-
getPriority
public float getPriority()
- Specified by:
getPriorityin interfaceorg.sonatype.maven.polyglot.mapping.Mapping
-
getFlavour
public String getFlavour()
- Specified by:
getFlavourin 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.ModelParseExceptionIOException
-
getBuildProperties
protected static Properties getBuildProperties(File dir) throws IOException
- Throws:
IOException
-
-