Package org.openquark.cal.compiler.CALDocComment

Examples of org.openquark.cal.compiler.CALDocComment.TextBlock


                //
                final int nAuthors = caldoc.getNAuthorBlocks();
                if (nAuthors > 0) {
                    for (int i = 0; i < nAuthors; i++) {
                        buffer.append("\n").append("@author ");
                        final TextBlock authorBlock = caldoc.getNthAuthorBlock(i);
                        buffer.append(getJavadocFriendlyHTMLForCALDocTextBlock(authorBlock, crossRefGen));
                    }
                }

                /// The version
                //
                final TextBlock versionBlock = caldoc.getVersionBlock();
                if (versionBlock != null) {
                    buffer.append("\n").append("@version ");
                    buffer.append(getJavadocFriendlyHTMLForCALDocTextBlock(versionBlock, crossRefGen));
                }
            }

            /// The deprecated block comes after all other blocks, according to the Javadoc style guide.
            //
            final TextBlock deprecatedBlock = caldoc.getDeprecatedBlock();
            if (deprecatedBlock != null) {
                buffer.append("\n").append("@deprecated ");
                buffer.append(getJavadocFriendlyHTMLForCALDocTextBlock(deprecatedBlock, crossRefGen));
            }
        }
View Full Code Here


                    final String returnTypeHTML = getTypeAsFormattedString(typePieceStrings[argNames.length], disallowJavadocCodeBlock);
                    buffer.append(CALDocMessages.getString("calTypeIndicator", returnTypeHTML)).append(" ");
                }

                if (hasReturnBlock) {
                    final TextBlock returnBlock = caldoc.getReturnBlock();
                    final String returnDescription = getJavadocFriendlyHTMLForCALDocTextBlock(returnBlock, crossRefGen);

                    if (typePieces != null && returnDescription.trim().length() > 0) {
                        // if there is both a type description and an return description, separate them
                        // with a newline and some indentation
View Full Code Here

       
        final StringBuilder buffer = new StringBuilder();
       
        /// The deprecated block comes first.
        //
        final TextBlock deprecatedBlock = caldoc.getDeprecatedBlock();
        if (deprecatedBlock != null) {
            buffer.append("[").append(CALDocMessages.getString("deprecatedColon")).append("\n");
            buffer.append(getTextFromCALDocTextBlockWithLeadingIndentAndTrailingNewline(deprecatedBlock, INDENT_LEVEL));
            buffer.append("]\n\n");
        }
       
        /// If the entity is a class method, then display whether it is required or optional
        //
        if (envEntity instanceof ClassMethod) {
            final ClassMethod method = (ClassMethod)envEntity;
           
            buffer.append("\n");
            if (method.getDefaultClassMethodName() == null) {
                // no default - required
                buffer.append(CALDocMessages.getString("requiredMethodIndicator"));
            } else {
                // has default - optional
                buffer.append(CALDocMessages.getString("optionalMethodIndicator"));
            }
            buffer.append("\n\n");
        }
       
        /// The main description
        //
        buffer.append(getTextFromCALDocTextBlockWithLeadingIndentAndTrailingNewline(caldoc.getDescriptionBlock(), 0));
       
        /// The arguments and the return value
        //
        buffer.append(getTextForArgumentsAndReturnValue(caldoc, envEntity, typeExpr, scopedEntityNamingPolicy));
       
        /// The authors
        //
        final int nAuthors = caldoc.getNAuthorBlocks();
        if (nAuthors > 0) {
            buffer.append("\n").append(CALDocMessages.getString("authorColon")).append("\n");
            for (int i = 0; i < nAuthors; i++) {
                final TextBlock authorBlock = caldoc.getNthAuthorBlock(i);
                buffer.append(getTextFromCALDocTextBlockWithLeadingIndentAndTrailingNewline(authorBlock, INDENT_LEVEL));
            }
        }
       
        /// The version
        //
        final TextBlock versionBlock = caldoc.getVersionBlock();
        if (versionBlock != null) {
            buffer.append("\n").append(CALDocMessages.getString("versionColon")).append("\n");
            buffer.append(getTextFromCALDocTextBlockWithLeadingIndentAndTrailingNewline(versionBlock, INDENT_LEVEL));
        }
       
View Full Code Here

                final String returnTypeString = typePieceStrings[arity];
                buffer.append(spaces(INDENT_LEVEL)).append(CALDocMessages.getString("returnValueIndicator")).append(" :: ").append(returnTypeString).append("\n");
            }
           
            if (hasReturnBlock) {
                final TextBlock returnBlock = caldoc.getReturnBlock();
                buffer.append(getTextFromCALDocTextBlockWithLeadingIndentAndTrailingNewline(returnBlock, INDENT_LEVEL * 2));
            }
        }
       
        return buffer.toString();
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.CALDocComment.TextBlock

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.