Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.DocletTag


     * @param tagName   not null
     * @return docletTag instance
     */
    private DocletTag findInClassHierarchy( JavaClass javaClass, String tagName )
    {
        DocletTag tag = javaClass.getTagByName( tagName );

        if ( tag == null )
        {
            JavaClass superClass = javaClass.getSuperJavaClass();

View Full Code Here


     * @return the boolean value of the given tagName
     * @see #findInClassHierarchy(JavaClass, String)
     */
    private static boolean getBooleanTagValue( JavaClass javaClass, String tagName, boolean defaultValue )
    {
        DocletTag tag = findInClassHierarchy( javaClass, tagName );

        if ( tag != null )
        {
            String value = tag.getValue();

            if ( StringUtils.isNotEmpty( value ) )
            {
                defaultValue = Boolean.valueOf( value ).booleanValue();
            }
View Full Code Here

     * @see #findInClassHierarchy(JavaClass, String)
     */
    private static boolean getBooleanTagValue( JavaClass javaClass, String tagName, boolean defaultForTag,
                                               boolean defaultValue )
    {
        DocletTag tag = findInClassHierarchy( javaClass, tagName );

        if ( tag != null )
        {
            String value = tag.getValue();

            if ( StringUtils.isNotEmpty( value ) )
            {
                return Boolean.valueOf( value ).booleanValue();
            }
View Full Code Here

     * @param tagName not null
     * @return docletTag instance
     */
    private static DocletTag findInClassHierarchy( JavaClass javaClass, String tagName )
    {
        DocletTag tag = javaClass.getTagByName( tagName );

        if ( tag == null )
        {
            JavaClass superClass = javaClass.getSuperJavaClass();

View Full Code Here

                pd.setType( value.toString() );
            }

            pd.setDescription( field.getComment() );

            DocletTag componentTag = field.getTagByName( JavaMojoAnnotation.COMPONENT );

            if ( componentTag != null )
            {
                String role = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLE );

                if ( role == null )
                {
                    role = field.getType().toString();
                }

                String roleHint = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLEHINT );

                if ( roleHint == null )
                {
                    // support alternate syntax for better compatibility with the Plexus CDC.
                    roleHint = componentTag.getNamedParameter( "role-hint" );
                }

                String expression = PluginUtils.MAVEN_COMPONENTS.get( role );

                if ( expression == null )
                {
                    pd.setRequirement( new Requirement( role, roleHint ) );
                }
                else
                {
                    pd.setDefaultValue( expression );
                    pd.setImplementation( role );
                    pd.setType( role );
                }

                pd.setEditable( false );
                /* TODO: or better like this? Need @component fields be editable for the user?
                pd.setEditable( field.getTagByName( READONLY ) == null );
                */
            }
            else
            {
                DocletTag parameter = field.getTagByName( JavaMojoAnnotation.PARAMETER );

                pd.setRequired( field.getTagByName( JavaMojoAnnotation.REQUIRED ) != null );

                pd.setEditable( field.getTagByName( JavaMojoAnnotation.READONLY ) == null );

                DocletTag deprecationTag = field.getTagByName( JavaMojoAnnotation.DEPRECATED );

                if ( deprecationTag != null )
                {
                    pd.setDeprecated( deprecationTag.getValue() );
                }

                DocletTag sinceTag = field.getTagByName( JavaMojoAnnotation.SINCE );
                if ( sinceTag != null )
                {
                    pd.setSince( sinceTag.getValue() );
                }

                String alias = parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_ALIAS );

                if ( !StringUtils.isEmpty( alias ) )
View Full Code Here

        List<MojoDescriptor> descriptors = new ArrayList<MojoDescriptor>();

        for ( JavaClass javaClass : javaClasses )
        {
            DocletTag tag = javaClass.getTagByName( GOAL );

            if ( tag != null )
            {
                MojoDescriptor mojoDescriptor = createMojoDescriptor( javaClass );
                mojoDescriptor.setPluginDescriptor( request.getPluginDescriptor() );
View Full Code Here

        for (int i = 0; i < javaSources.length; i++) {
            JavaClass mojoClass = javaSources[i].getClasses()[0];

            // need plugin inheritance
            DocletTag extendsTag = mojoClass.getTagByName(EXTENDS_PLUGIN);
            if (null != extendsTag) {
                String pluginName = extendsTag.getValue();
                getLog().info("Extending " + pluginName + " plugin");

                // lookup using simple plugin name (ie. compiler, archetype, etc.)
                PluginXml superPlugin = getDependentPluginMetaData(pluginName);
View Full Code Here

     * @param superPlugin  plugin metadata being extended
     * @throws MojoExecutionException
     */
    private void mergePluginMojo(JavaClass mojoClass, PluginXml targetPlugin, PluginXml superPlugin)
            throws MojoExecutionException {
        DocletTag goalTag = mojoClass.getTagByName(GOAL);
        if (null == goalTag) {
            return;
        }

        DocletTag superGoalTag = mojoClass.getTagByName(EXTENDS_GOAL);
        if (null == superGoalTag) {
            superGoalTag = goalTag;
        }

        String goal = goalTag.getValue();
        String superGoal = superGoalTag.getValue();

        getLog().info(superGoal + " => " + goal);

        Xpp3Dom targetMojoXml = targetPlugin.findMojo(goal);
        Xpp3Dom superMojoXml = superPlugin.findMojo(superGoal);
View Full Code Here

     */
    public Annotation[] getAnnotations(final String name, final JavaField field) {
        DocletTag[] tags = field.getTags();
        List annotations = new ArrayList();
        for (int i = 0; i < tags.length; i++) {
            DocletTag tag = tags[i];
            String tagName = tag.getName().trim();
            String value = Strings.removeFormattingCharacters(tag.getValue().trim());
            if (name.equals(tagName) && m_registeredAnnotations.containsKey(tagName)) {
                Class proxyClass = (Class) m_registeredAnnotations.get(tagName);
                Annotation annotation;
                try {
                    annotation = (Annotation) proxyClass.newInstance();
View Full Code Here

     */
    public Annotation[] getAnnotations(final String name, final JavaClass clazz) {
        DocletTag[] tags = clazz.getTags();
        List annotations = new ArrayList();
        for (int i = 0; i < tags.length; i++) {
            DocletTag tag = tags[i];
            String tagName = tag.getName().trim();
            String value = Strings.removeFormattingCharacters(tag.getValue().trim());
            if (name.equals(tagName) && m_registeredAnnotations.containsKey(tagName)) {
                Class proxyClass = (Class) m_registeredAnnotations.get(tagName);
                Annotation annotation;
                try {
                    annotation = (Annotation) proxyClass.newInstance();
View Full Code Here

TOP

Related Classes of com.thoughtworks.qdox.model.DocletTag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.