1 49 50 package org.apache.avalon.meta.info.builder.tags; 51 52 53 import com.thoughtworks.qdox.model.DocletTag; 54 import com.thoughtworks.qdox.model.JavaClass; 55 import com.thoughtworks.qdox.model.JavaMethod; 56 57 import java.util.ArrayList ; 58 import java.util.HashSet ; 59 import java.util.Set ; 60 61 67 public class SchemaTag extends AbstractTag 68 { 69 72 protected static final String CONFIGURATION_CLASS = 73 "org.apache.avalon.framework.configuration.Configuration"; 74 75 78 protected static final String KEY = "configuration"; 79 80 83 public static final String SCHEMA_PARAM = "schema"; 84 85 private JavaMethod[] m_methods; 86 87 91 public SchemaTag( final JavaClass clazz ) 92 { 93 super( clazz ); 94 setMethods(); 95 } 96 97 101 public String getConfigurationSchema() 102 { 103 if( m_methods.length > 0 ) 104 { 105 final DocletTag[] tags = 106 m_methods[0].getTagsByName( getNS() + Tags.DELIMITER + KEY ); 107 if( tags.length > 0 ) 108 { 109 DocletTag tag = tags[0]; 110 return getNamedParameter( tag, SCHEMA_PARAM, null ); 111 } 112 } 113 return null; 114 } 115 116 119 private void setMethods() 120 { 121 m_methods = getLifecycleMethods( "configure", CONFIGURATION_CLASS ); 122 } 123 } 124 | Popular Tags |