001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.maven.tools.plugin.extractor.annotations.datamodel;
020
021import java.lang.annotation.Annotation;
022
023import org.apache.maven.plugins.annotations.Execute;
024import org.apache.maven.plugins.annotations.LifecyclePhase;
025
026/**
027 * @author Olivier Lamy
028 * @since 3.0
029 */
030public class ExecuteAnnotationContent implements Execute {
031    private String goal;
032
033    private String lifecycle;
034
035    private LifecyclePhase phase;
036
037    private String customPhase;
038
039    @Override
040    public LifecyclePhase phase() {
041        return this.phase;
042    }
043
044    @Override
045    public String customPhase() {
046        return customPhase;
047    }
048
049    @Override
050    public String goal() {
051        return this.goal;
052    }
053
054    @Override
055    public String lifecycle() {
056        return this.lifecycle;
057    }
058
059    public void phase(String phase) {
060        this.phase = LifecyclePhase.valueOf(phase);
061    }
062
063    public void customPhase(String customPhase) {
064        this.customPhase = customPhase;
065    }
066
067    public void goal(String goal) {
068        this.goal = goal;
069    }
070
071    public void lifecycle(String lifecycle) {
072        this.lifecycle = lifecycle;
073    }
074
075    @Override
076    public Class<? extends Annotation> annotationType() {
077        return null;
078    }
079
080    @Override
081    public String toString() {
082        final StringBuilder sb = new StringBuilder();
083        sb.append("ExecuteAnnotationContent");
084        sb.append("{goal='").append(goal).append('\'');
085        sb.append(", lifecycle='").append(lifecycle).append('\'');
086        sb.append(", phase=").append(phase);
087        sb.append(", customPhase=").append(customPhase);
088        sb.append('}');
089        return sb.toString();
090    }
091}