Package org.codehaus.mojo.flatten
Class PomProperty<V>
- java.lang.Object
-
- org.codehaus.mojo.flatten.PomProperty<V>
-
- Type Parameters:
V
- is the generic type of theproperty value
.
public abstract class PomProperty<V> extends java.lang.Object
This class reflects a property of aPOM
. It containsall available properties
as constants and allows generic access toread
andwrite
the property via aModel
.- Since:
- 1.0.0-beta-4
-
-
Field Summary
Fields Modifier and Type Field Description static PomProperty<java.lang.String>
ARTIFACT_ID
static PomProperty<org.apache.maven.model.Build>
BUILD
static PomProperty<org.apache.maven.model.CiManagement>
CI_MANAGEMENT
static PomProperty<java.util.List<org.apache.maven.model.Contributor>>
CONTRIBUTORS
static PomProperty<java.util.List<org.apache.maven.model.Dependency>>
DEPENDENCIES
static PomProperty<org.apache.maven.model.DependencyManagement>
DEPENDENCY_MANAGEMENT
static PomProperty<java.lang.String>
DESCRIPTION
static PomProperty<java.util.List<org.apache.maven.model.Developer>>
DEVELOPERS
static PomProperty<org.apache.maven.model.DistributionManagement>
DISTRIBUTION_MANAGEMENT
static PomProperty<java.lang.String>
GROUP_ID
static PomProperty<java.lang.String>
INCEPTION_YEAR
static PomProperty<org.apache.maven.model.IssueManagement>
ISSUE_MANAGEMENT
static PomProperty<java.util.List<org.apache.maven.model.License>>
LICENSES
static PomProperty<java.util.List<org.apache.maven.model.MailingList>>
MAILING_LISTS
static PomProperty<java.lang.String>
MODEL_ENCODING
static PomProperty<java.lang.String>
MODEL_VERSION
static PomProperty<java.util.List<java.lang.String>>
MODULES
private java.lang.String
name
static PomProperty<java.lang.String>
NAME
static PomProperty<org.apache.maven.model.Organization>
ORGANIZATION
static PomProperty<java.lang.String>
PACKAGING
static PomProperty<org.apache.maven.model.Parent>
PARENT
static PomProperty<org.apache.maven.model.PluginManagement>
PLUGIN_MANAGEMENT
static PomProperty<java.util.List<org.apache.maven.model.Repository>>
PLUGIN_REPOSITORIES
static PomProperty<java.io.File>
POM_FILE
private static java.util.List<PomProperty<?>>
POM_PROPERTIES
private static PomProperty<?>[]
POM_PROPERTIES_ARRAY
static PomProperty<org.apache.maven.model.Prerequisites>
PREREQUISITES
static PomProperty<java.util.List<org.apache.maven.model.Profile>>
PROFILES
static PomProperty<java.util.Properties>
PROPERTIES
static PomProperty<org.apache.maven.model.Reporting>
REPORTING
static PomProperty<java.util.List<org.apache.maven.model.Repository>>
REPOSITORIES
static PomProperty<org.apache.maven.model.Scm>
SCM
static PomProperty<java.lang.String>
URL
private java.lang.Class<V>
valueType
static PomProperty<java.lang.String>
VERSION
-
Constructor Summary
Constructors Constructor Description PomProperty(java.lang.String name, java.lang.Class<V> valueType)
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
copy(org.apache.maven.model.Model source, org.apache.maven.model.Model target)
Copies the value identified by thisPomProperty
from the givensource
Model
to the giventarget
Model
.abstract V
get(org.apache.maven.model.Model model)
Generic getter for reading aPomProperty
from aModel
.java.lang.String
getName()
static java.util.List<PomProperty<?>>
getPomProperties()
java.lang.Class<V>
getValueType()
boolean
isElement()
boolean
isRequired()
abstract void
set(org.apache.maven.model.Model model, V value)
Generic setter for writing aPomProperty
in aModel
.java.lang.String
toString()
-
-
-
Field Detail
-
ARTIFACT_ID
public static final PomProperty<java.lang.String> ARTIFACT_ID
- See Also:
Model.getArtifactId()
-
BUILD
public static final PomProperty<org.apache.maven.model.Build> BUILD
- See Also:
Model.getBuild()
-
CI_MANAGEMENT
public static final PomProperty<org.apache.maven.model.CiManagement> CI_MANAGEMENT
- See Also:
Model.getCiManagement()
-
CONTRIBUTORS
public static final PomProperty<java.util.List<org.apache.maven.model.Contributor>> CONTRIBUTORS
- See Also:
Model.getContributors()
-
DEPENDENCIES
public static final PomProperty<java.util.List<org.apache.maven.model.Dependency>> DEPENDENCIES
- See Also:
ModelBase.getDependencies()
-
DEPENDENCY_MANAGEMENT
public static final PomProperty<org.apache.maven.model.DependencyManagement> DEPENDENCY_MANAGEMENT
- See Also:
ModelBase.getDependencyManagement()
-
DESCRIPTION
public static final PomProperty<java.lang.String> DESCRIPTION
- See Also:
Model.getDescription()
-
DEVELOPERS
public static final PomProperty<java.util.List<org.apache.maven.model.Developer>> DEVELOPERS
- See Also:
Model.getDevelopers()
-
DISTRIBUTION_MANAGEMENT
public static final PomProperty<org.apache.maven.model.DistributionManagement> DISTRIBUTION_MANAGEMENT
- See Also:
ModelBase.getDistributionManagement()
-
GROUP_ID
public static final PomProperty<java.lang.String> GROUP_ID
- See Also:
Model.getGroupId()
-
INCEPTION_YEAR
public static final PomProperty<java.lang.String> INCEPTION_YEAR
- See Also:
Model.getInceptionYear()
-
ISSUE_MANAGEMENT
public static final PomProperty<org.apache.maven.model.IssueManagement> ISSUE_MANAGEMENT
- See Also:
Model.getIssueManagement()
-
LICENSES
public static final PomProperty<java.util.List<org.apache.maven.model.License>> LICENSES
- See Also:
Model.getLicenses()
-
MAILING_LISTS
public static final PomProperty<java.util.List<org.apache.maven.model.MailingList>> MAILING_LISTS
- See Also:
Model.getMailingLists()
-
MODEL_ENCODING
public static final PomProperty<java.lang.String> MODEL_ENCODING
- See Also:
Model.getModelEncoding()
-
MODEL_VERSION
public static final PomProperty<java.lang.String> MODEL_VERSION
- See Also:
Model.getModelVersion()
-
MODULES
public static final PomProperty<java.util.List<java.lang.String>> MODULES
- See Also:
ModelBase.getModules()
-
NAME
public static final PomProperty<java.lang.String> NAME
- See Also:
Model.getName()
-
ORGANIZATION
public static final PomProperty<org.apache.maven.model.Organization> ORGANIZATION
- See Also:
Model.getOrganization()
-
PACKAGING
public static final PomProperty<java.lang.String> PACKAGING
- See Also:
Model.getPackaging()
-
PARENT
public static final PomProperty<org.apache.maven.model.Parent> PARENT
- See Also:
Model.getParent()
-
PLUGIN_MANAGEMENT
public static final PomProperty<org.apache.maven.model.PluginManagement> PLUGIN_MANAGEMENT
- See Also:
PluginConfiguration.getPluginManagement()
-
PLUGIN_REPOSITORIES
public static final PomProperty<java.util.List<org.apache.maven.model.Repository>> PLUGIN_REPOSITORIES
- See Also:
ModelBase.getPluginRepositories()
-
POM_FILE
public static final PomProperty<java.io.File> POM_FILE
- See Also:
Model.getPomFile()
-
PREREQUISITES
public static final PomProperty<org.apache.maven.model.Prerequisites> PREREQUISITES
- See Also:
Model.getPrerequisites()
-
PROFILES
public static final PomProperty<java.util.List<org.apache.maven.model.Profile>> PROFILES
- See Also:
Model.getProfiles()
-
PROPERTIES
public static final PomProperty<java.util.Properties> PROPERTIES
- See Also:
ModelBase.getProperties()
-
REPORTING
public static final PomProperty<org.apache.maven.model.Reporting> REPORTING
- See Also:
ModelBase.getReporting()
-
REPOSITORIES
public static final PomProperty<java.util.List<org.apache.maven.model.Repository>> REPOSITORIES
- See Also:
ModelBase.getPluginRepositories()
-
SCM
public static final PomProperty<org.apache.maven.model.Scm> SCM
- See Also:
Model.getScm()
-
URL
public static final PomProperty<java.lang.String> URL
- See Also:
Model.getUrl()
-
VERSION
public static final PomProperty<java.lang.String> VERSION
- See Also:
Model.getVersion()
-
POM_PROPERTIES_ARRAY
private static final PomProperty<?>[] POM_PROPERTIES_ARRAY
-
POM_PROPERTIES
private static final java.util.List<PomProperty<?>> POM_PROPERTIES
-
name
private final java.lang.String name
-
valueType
private final java.lang.Class<V> valueType
-
-
Constructor Detail
-
PomProperty
public PomProperty(java.lang.String name, java.lang.Class<V> valueType)
The constructor.- Parameters:
name
- - seegetName()
.valueType
- - seegetValueType()
.
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- name
-
getValueType
public java.lang.Class<V> getValueType()
- Returns:
Class
reflecting the type of theproperty value
.
-
isRequired
public boolean isRequired()
- Returns:
true
if required for flattened POM,false
otherwise.
-
isElement
public boolean isElement()
- Returns:
true
if this property represents an XML element of the POM representation,false
otherwise (if an internal property such asModel.getPomFile()
).
-
get
public abstract V get(org.apache.maven.model.Model model)
Generic getter for reading aPomProperty
from aModel
.- Parameters:
model
- is theModel
to read from.- Returns:
- the value of the property to read identified by this
PomProperty
.
-
set
public abstract void set(org.apache.maven.model.Model model, V value)
Generic setter for writing aPomProperty
in aModel
.- Parameters:
model
- is theModel
to write to.value
- is the value of the property to write identified by thisPomProperty
.
-
copy
public void copy(org.apache.maven.model.Model source, org.apache.maven.model.Model target)
Copies the value identified by thisPomProperty
from the givensource
Model
to the giventarget
Model
.- Parameters:
source
- is theModel
to copy from (read).target
- is theModel
to copy to (write).
-
getPomProperties
public static java.util.List<PomProperty<?>> getPomProperties()
- Returns:
- an
unmodifiable
List
with allproperties
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-