Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.JavaField


        // fields
        List fieldList = new ArrayList();
        JavaField[] fields = javaClass.getFields();
        for (int i = 0; i < fields.length; i++) {
            JavaField field = fields[i];
            fieldList.add(createFieldMetaData(field));
        }
        classMetaData.setFields(fieldList);

        // interfaces
View Full Code Here


     */
    private void parseFieldAttributes(final JavaClass javaClass,
                                      final AttributeEnhancer enhancer) {
        JavaField[] javaFields = javaClass.getFields();
        for (int j = 0; j < javaFields.length; j++) {
            JavaField javaField = javaFields[j];
            parseCustomAttributes(javaField, enhancer);
            parseExecutionPointcut(javaField, enhancer);
            parseCallPointcut(javaField, enhancer);
            parseClassPointcut(javaField, enhancer);
            parseSetPointcut(javaField, enhancer);
View Full Code Here

        // Search the current class for requirements
        // ----------------------------------------------------------------------

        for ( int i = 0; i < fields.length; i++ )
        {
            JavaField field = fields[i];

            DocletTag tag = field.getTagByName( PLEXUS_REQUIREMENT_TAG );

            if ( tag == null )
            {
                continue;
            }

            Map<String, String> parameters = new HashMap<String, String>( tag.getNamedParameterMap() );

            // ----------------------------------------------------------------------
            // Role
            // ----------------------------------------------------------------------

            String requirementClass = field.getType().getJavaClass().getFullyQualifiedName();

            boolean isMap = requirementClass.equals( Map.class.getName() ) ||
                    requirementClass.equals( Collection.class.getName() );

            try
            {
                isMap = isMap || Collection.class.isAssignableFrom( Class.forName( requirementClass ) );
            }
            catch ( ClassNotFoundException e )
            {
                // ignore the assignable Collection test, though this should never happen
            }

            boolean isList = requirementClass.equals( List.class.getName() );

            ComponentRequirement cr;

            String hint = getParameter( parameters, PLEXUS_ROLE_HINT_PARAMETER );

            if ( isMap || isList )
            {
                cr = new ComponentRequirementList();

                String hintList = getParameter( parameters, PLEXUS_ROLE_HINT_LIST_PARAMETER );

                if ( hintList != null )
                {
                    String[] hintArr = hintList.split( "," );

                    ( (ComponentRequirementList) cr).setRoleHints( Arrays.asList( hintArr ) );
                }
            }
            else
            {
                cr = new ComponentRequirement();

                cr.setRoleHint( hint );
            }

            String role = getParameter( parameters, PLEXUS_ROLE_PARAMETER );

            if ( role == null )
            {
                cr.setRole( requirementClass );
            }
            else
            {
                cr.setRole( role );
            }

            cr.setFieldName( field.getName() );

            if ( isMap || isList )
            {
                if ( hint != null )
                {
View Full Code Here

        // Search the current class for configurable fields.
        // ----------------------------------------------------------------------

        for ( int i = 0; i < fields.length; i++ )
        {
            JavaField field = fields[i];

            DocletTag tag = field.getTagByName( PLEXUS_CONFIGURATION_TAG );

            if ( tag == null )
            {
                continue;
            }

            Map<String, String> parameters = new HashMap<String, String>( tag.getNamedParameterMap() );

            /* don't use the getParameter helper as we like empty strings */
            String defaultValue = parameters.remove( PLEXUS_DEFAULT_VALUE_PARAMETER );

            if ( defaultValue == null )
            {
                /*
                log.warn( "Component: " + javaClass.getName() + ", field name: '" + field.getName() + "': " +
                    "Currently configurable fields will not be written to the descriptor " +
                    "without a default value." );*/

                continue;
            }

            String name = deHump( field.getName() );

            XmlPlexusConfiguration c;

            c = new XmlPlexusConfiguration( name );

View Full Code Here

            }
         }
      }
      for (int i = 0; i < clazz.getFields().length; i++)
      {
         JavaField field = clazz.getFields()[i];
         for (int j = 0; j < field.getTags().length; j++)
         {
            AnnotationDocletTag tag = (AnnotationDocletTag) field.getTags()[j];
            if (tag.getAnnotation() == null) continue;
            modified = true;
            compileField(field, tag, ctClass);
         }
      }
View Full Code Here

                getParametersParentHierarchy( entry.getValue(), new HashMap<String, ParameterAnnotationContent>(),
                                              mojoAnnotatedClasses );
            for ( Map.Entry<String, ParameterAnnotationContent> parameter : new TreeMap<String, ParameterAnnotationContent>(
                parameters ).entrySet() )
            {
                JavaField javaField = fieldsMap.get( parameter.getKey() );
                if ( javaField == null )
                {
                    continue;
                }

                ParameterAnnotationContent parameterAnnotationContent = parameter.getValue();
                parameterAnnotationContent.setDescription( javaField.getComment() );

                DocletTag deprecated = javaField.getTagByName( "deprecated" );
                if ( deprecated != null )
                {
                    parameterAnnotationContent.setDeprecated( deprecated.getValue() );
                }

                DocletTag since = javaField.getTagByName( "since" );
                if ( since != null )
                {
                    parameterAnnotationContent.setSince( since.getValue() );
                }
            }

            // populate components
            for ( Map.Entry<String, ComponentAnnotationContent> component : entry.getValue().getComponents().entrySet() )
            {
                JavaField javaField = fieldsMap.get( component.getKey() );
                if ( javaField == null )
                {
                    continue;
                }

                ComponentAnnotationContent componentAnnotationContent = component.getValue();
                componentAnnotationContent.setDescription( javaField.getComment() );

                DocletTag deprecated = javaField.getTagByName( "deprecated" );
                if ( deprecated != null )
                {
                    componentAnnotationContent.setDeprecated( deprecated.getValue() );
                }

                DocletTag since = javaField.getTagByName( "since" );
                if ( since != null )
                {
                    componentAnnotationContent.setSince( since.getValue() );
                }
            }
View Full Code Here

TOP

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

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.