View Javadoc
1   /*
2    * Licensed under the Apache License, Version 2.0 (the "License");
3    * you may not use this file except in compliance with the License.
4    * You may obtain a copy of the License at
5    *
6    * http://www.apache.org/licenses/LICENSE-2.0
7    *
8    * Unless required by applicable law or agreed to in writing, software
9    * distributed under the License is distributed on an "AS IS" BASIS,
10   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11   * See the License for the specific language governing permissions and
12   * limitations under the License.
13   */
14  
15  package org.basepom.mojo.propertyhelper;
16  
17  
18  import java.io.IOException;
19  import java.util.Optional;
20  
21  import org.apache.maven.plugin.MojoExecutionException;
22  
23  /**
24   * Defines a property element.
25   */
26  public interface PropertyElement {
27  
28      /**
29       * The name of the property element.
30       */
31      String getPropertyName();
32  
33      /**
34       * The value of the property. {@link Optional#empty()} can be returned if the value is not defined.
35       */
36      Optional<String> getPropertyValue() throws MojoExecutionException, IOException;
37  
38      /**
39       * True if the value of this element should be exposed as a maven property.
40       */
41      boolean isExport();
42  }