Package com.atlassian.json.schema.doclet.model

Examples of com.atlassian.json.schema.doclet.model.SchemaFieldDoc


        for (FieldDoc fieldDoc : classDoc.fields())
        {
            if (!fieldDoc.isTransient() && !fieldDoc.isStatic() && !hasAnnotation(fieldDoc, SchemaIgnore.class))
            {
                SchemaFieldDoc schemaFieldDoc = new SchemaFieldDoc();
                schemaFieldDoc.setFieldName(fieldDoc.name());
                schemaFieldDoc.setFieldTitle(getTitle(fieldDoc));

                Doc docForField = fieldDoc;
               
                String originalText = fieldDoc.commentText();
                Tag[] originalInlineTags = fieldDoc.inlineTags();

                boolean revertInlineTags = false;
               
                if (fieldDocOverrides.containsKey(fieldDoc.name()))
                {
                    docForField.setRawCommentText(fieldDocOverrides.get(fieldDoc.name()));
                   
                    //this sucks, but setting the comment text does NOT clear the tag cache
                    Class docImpl = fieldDoc.getClass().getSuperclass().getSuperclass().getSuperclass();
                    Field inlineTagsField = docImpl.getDeclaredField("inlineTags");
                    inlineTagsField.setAccessible(true);
                    inlineTagsField.set(docForField,null);
                    revertInlineTags = true;
                }
                else if (Strings.isNullOrEmpty(fieldDoc.commentText()))
                {
                    MethodDoc accessor = findFieldAccessor(classDoc, fieldDoc);
                    if (null != accessor && !Strings.isNullOrEmpty(accessor.commentText()))
                    {
                        docForField = accessor;
                    }
                }

                schemaFieldDoc.setFieldDocs(getDocWithIncludes(docForField));

                schemaFieldDocs.add(schemaFieldDoc);
               
                if(revertInlineTags)
                {
View Full Code Here


        List<SchemaClassDoc> classDocs = new ArrayList<SchemaClassDoc>();
        SchemaClassDoc classDoc = new SchemaClassDoc();
        classDoc.setClassName(FoodObject.class.getName());
       
        List<SchemaFieldDoc> fieldDocs = new ArrayList<SchemaFieldDoc>();
        SchemaFieldDoc fieldDoc = new SchemaFieldDoc();
        fieldDoc.setFieldName("color");
        fieldDoc.setFieldTitle("The Color");
        fieldDoc.setFieldDocs("The color of a food");
        fieldDocs.add(fieldDoc);
       
        classDoc.setClassTitle("Mmmm... Food");
        classDoc.setClassDoc("Food is good, you should eat it");
        classDoc.setFieldDocs(fieldDocs);
View Full Code Here

    {
        SchemaClassDoc classDoc = schemaDocs.getClassDoc(theClass.getName());

        if (null != classDoc)
        {
            SchemaFieldDoc fieldDoc = classDoc.getFieldDoc(theField.getName());

            if (null != fieldDoc)
            {
                if (isNotBlank(fieldDoc.getFieldTitle()))
                {
                    schema.setFieldTitle(fieldDoc.getFieldTitle());
                }

                if (isNotBlank(fieldDoc.getFieldDocs()))
                {
                    schema.setFieldDescription(fieldDoc.getFieldDocs());
                }
            }
        }
    }
View Full Code Here

    {
        SchemaClassDoc classDoc = schemaDocs.getClassDoc(theClass.getName());
        String title = null;
        if (null != classDoc)
        {
            SchemaFieldDoc fieldDoc = classDoc.getFieldDoc(theField.getName());

            if (null != fieldDoc)
            {
                if (isNotBlank(fieldDoc.getFieldTitle()))
                {
                    title = fieldDoc.getFieldTitle();
                }
            }
        }

        if (null == title)
View Full Code Here

TOP

Related Classes of com.atlassian.json.schema.doclet.model.SchemaFieldDoc

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.