Class PomProperty<V>

  • Type Parameters:
    V - is the generic type of the property value.

    public abstract class PomProperty<V>
    extends java.lang.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 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 - - see getName().
        valueType - - see getValueType().
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns:
        name
      • getValueType

        public java.lang.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 java.util.List<PomProperty<?>> getPomProperties()
        Returns:
        an unmodifiable List with all properties.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object