1 49 50 package org.apache.avalon.meta.info.builder.tags; 51 52 import java.util.Properties ; 53 54 import org.apache.avalon.framework.Version; 55 import org.apache.avalon.meta.info.ReferenceDescriptor; 56 import org.apache.avalon.meta.info.Service; 57 58 import com.thoughtworks.qdox.model.DocletTag; 59 import com.thoughtworks.qdox.model.JavaClass; 60 61 67 public class ServiceTag extends AbstractTag 68 { 69 72 public static final String KEY = "service"; 73 74 77 public static final String VERSION_PARAM = "version"; 78 79 83 public ServiceTag( final JavaClass clazz ) 84 { 85 super( clazz ); 86 } 87 88 92 public Service getService() 93 { 94 final DocletTag tag = getJavaClass().getTagByName( getNS() + Tags.DELIMITER + KEY ); 95 if( null == tag ) 96 { 97 return null; 98 } 99 final Version version = Version.getVersion( getNamedParameter( tag, VERSION_PARAM, "" ) ); 100 final String type = getJavaClass().getFullyQualifiedName(); 101 final Properties properties = new AttributeTag( getJavaClass() ).getProperties(); 102 final ReferenceDescriptor ref = new ReferenceDescriptor( type, version ); 103 return new Service( ref, properties ); 104 } 105 } 106 | Popular Tags |