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.Component;
024
025/**
026 * @author Olivier Lamy
027 * @since 3.0
028 */
029public class ComponentAnnotationContent extends AnnotatedField implements Component {
030    private String roleClassName;
031
032    private String hint;
033
034    public ComponentAnnotationContent(String fieldName) {
035        super(fieldName);
036    }
037
038    public ComponentAnnotationContent(String fieldName, String role, String hint) {
039        this(fieldName);
040        this.roleClassName = role;
041        this.hint = hint;
042    }
043
044    @Override
045    public Class<?> role() {
046        // not used
047        return null;
048    }
049
050    public void setRoleClassName(String roleClassName) {
051        this.roleClassName = roleClassName;
052    }
053
054    public String getRoleClassName() {
055        return roleClassName;
056    }
057
058    @Override
059    public String hint() {
060        return hint == null ? "" : hint;
061    }
062
063    public void hint(String hint) {
064        this.hint = hint;
065    }
066
067    @Override
068    public Class<? extends Annotation> annotationType() {
069        return null;
070    }
071
072    @Override
073    public String toString() {
074        final StringBuilder sb = new StringBuilder();
075        sb.append(super.toString());
076        sb.append("ComponentAnnotationContent");
077        sb.append("{role='").append(roleClassName).append('\'');
078        sb.append(", hint='").append(hint).append('\'');
079        sb.append('}');
080        return sb.toString();
081    }
082}