Class PomProperty<V>

java.lang.Object
org.codehaus.mojo.flatten.PomProperty<V>
Type Parameters:
V - is the generic type of the property value.

public abstract class PomProperty<V> extends Object
This class reflects a property of a POM. It contains all available properties as constants and allows generic access to read and write the property via a Model.
Since:
1.0.0-beta-4
  • Field Details

    • ARTIFACT_ID

      public static final PomProperty<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<List<org.apache.maven.model.Contributor>> CONTRIBUTORS
      See Also:
      • Model.getContributors()
    • DEPENDENCIES

      public static final PomProperty<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<String> DESCRIPTION
      See Also:
      • Model.getDescription()
    • DEVELOPERS

      public static final PomProperty<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<String> GROUP_ID
      See Also:
      • Model.getGroupId()
    • INCEPTION_YEAR

      public static final PomProperty<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<List<org.apache.maven.model.License>> LICENSES
      See Also:
      • Model.getLicenses()
    • MAILING_LISTS

      public static final PomProperty<List<org.apache.maven.model.MailingList>> MAILING_LISTS
      See Also:
      • Model.getMailingLists()
    • MODEL_ENCODING

      public static final PomProperty<String> MODEL_ENCODING
      See Also:
      • Model.getModelEncoding()
    • MODEL_VERSION

      public static final PomProperty<String> MODEL_VERSION
      See Also:
      • Model.getModelVersion()
    • MODULES

      public static final PomProperty<List<String>> MODULES
      See Also:
      • ModelBase.getModules()
    • NAME

      public static final PomProperty<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<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<List<org.apache.maven.model.Repository>> PLUGIN_REPOSITORIES
      See Also:
      • ModelBase.getPluginRepositories()
    • POM_FILE

      public static final PomProperty<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<List<org.apache.maven.model.Profile>> PROFILES
      See Also:
      • Model.getProfiles()
    • PROPERTIES

      public static final PomProperty<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<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<String> URL
      See Also:
      • Model.getUrl()
    • VERSION

      public static final PomProperty<String> VERSION
      See Also:
      • Model.getVersion()
    • POM_PROPERTIES_ARRAY

      private static final PomProperty<?>[] POM_PROPERTIES_ARRAY
    • POM_PROPERTIES

      private static final List<PomProperty<?>> POM_PROPERTIES
    • name

      private final String name
    • valueType

      private final Class<V> valueType
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Returns:
      name
    • getValueType

      public Class<V> getValueType()
      Returns:
      Class reflecting the type of the property 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 as Model.getPomFile()).
    • get

      public abstract V get(org.apache.maven.model.Model model)
      Generic getter for reading a PomProperty from a Model.
      Parameters:
      model - is the Model 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 a PomProperty in a Model.
      Parameters:
      model - is the Model to write to.
      value - is the value of the property to write identified by this PomProperty.
    • copy

      public void copy(org.apache.maven.model.Model source, org.apache.maven.model.Model target)
      Copies the value identified by this PomProperty from the given source Model to the given target Model.
      Parameters:
      source - is the Model to copy from (read).
      target - is the Model to copy to (write).
    • getPomProperties

      public static List<PomProperty<?>> getPomProperties()
      Returns:
      an unmodifiable List with all properties.