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.ObjectThis class reflects a property of aPOM. It containsall available propertiesas constants and allows generic access toreadandwritethe property via aModel.- Since:
- 1.0.0-beta-4
-
-
Field Summary
Fields Modifier and Type Field Description static PomProperty<java.lang.String>ARTIFACT_IDstatic PomProperty<org.apache.maven.model.Build>BUILDstatic PomProperty<org.apache.maven.model.CiManagement>CI_MANAGEMENTstatic PomProperty<java.util.List<org.apache.maven.model.Contributor>>CONTRIBUTORSstatic PomProperty<java.util.List<org.apache.maven.model.Dependency>>DEPENDENCIESstatic PomProperty<org.apache.maven.model.DependencyManagement>DEPENDENCY_MANAGEMENTstatic PomProperty<java.lang.String>DESCRIPTIONstatic PomProperty<java.util.List<org.apache.maven.model.Developer>>DEVELOPERSstatic PomProperty<org.apache.maven.model.DistributionManagement>DISTRIBUTION_MANAGEMENTstatic PomProperty<java.lang.String>GROUP_IDstatic PomProperty<java.lang.String>INCEPTION_YEARstatic PomProperty<org.apache.maven.model.IssueManagement>ISSUE_MANAGEMENTstatic PomProperty<java.util.List<org.apache.maven.model.License>>LICENSESstatic PomProperty<java.util.List<org.apache.maven.model.MailingList>>MAILING_LISTSstatic PomProperty<java.lang.String>MODEL_ENCODINGstatic PomProperty<java.lang.String>MODEL_VERSIONstatic PomProperty<java.util.List<java.lang.String>>MODULESprivate java.lang.Stringnamestatic PomProperty<java.lang.String>NAMEstatic PomProperty<org.apache.maven.model.Organization>ORGANIZATIONstatic PomProperty<java.lang.String>PACKAGINGstatic PomProperty<org.apache.maven.model.Parent>PARENTstatic PomProperty<org.apache.maven.model.PluginManagement>PLUGIN_MANAGEMENTstatic PomProperty<java.util.List<org.apache.maven.model.Repository>>PLUGIN_REPOSITORIESstatic PomProperty<java.io.File>POM_FILEprivate static java.util.List<PomProperty<?>>POM_PROPERTIESprivate static PomProperty<?>[]POM_PROPERTIES_ARRAYstatic PomProperty<org.apache.maven.model.Prerequisites>PREREQUISITESstatic PomProperty<java.util.List<org.apache.maven.model.Profile>>PROFILESstatic PomProperty<java.util.Properties>PROPERTIESstatic PomProperty<org.apache.maven.model.Reporting>REPORTINGstatic PomProperty<java.util.List<org.apache.maven.model.Repository>>REPOSITORIESstatic PomProperty<org.apache.maven.model.Scm>SCMstatic PomProperty<java.lang.String>URLprivate java.lang.Class<V>valueTypestatic 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 voidcopy(org.apache.maven.model.Model source, org.apache.maven.model.Model target)Copies the value identified by thisPomPropertyfrom the givensourceModelto the giventargetModel.abstract Vget(org.apache.maven.model.Model model)Generic getter for reading aPomPropertyfrom aModel.java.lang.StringgetName()static java.util.List<PomProperty<?>>getPomProperties()java.lang.Class<V>getValueType()booleanisElement()booleanisRequired()abstract voidset(org.apache.maven.model.Model model, V value)Generic setter for writing aPomPropertyin aModel.java.lang.StringtoString()
-
-
-
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:
Classreflecting the type of theproperty value.
-
isRequired
public boolean isRequired()
- Returns:
trueif required for flattened POM,falseotherwise.
-
isElement
public boolean isElement()
- Returns:
trueif this property represents an XML element of the POM representation,falseotherwise (if an internal property such asModel.getPomFile()).
-
get
public abstract V get(org.apache.maven.model.Model model)
Generic getter for reading aPomPropertyfrom aModel.- Parameters:
model- is theModelto 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 aPomPropertyin aModel.- Parameters:
model- is theModelto 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 thisPomPropertyfrom the givensourceModelto the giventargetModel.- Parameters:
source- is theModelto copy from (read).target- is theModelto copy to (write).
-
getPomProperties
public static java.util.List<PomProperty<?>> getPomProperties()
- Returns:
- an
unmodifiableListwith allproperties.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-