Package oms3.annotations

Examples of oms3.annotations.Documentation


        }
        sb.append(NEWLINE);

        // gather input fields
        Object annotatedObject = moduleClass.newInstance();
        ComponentAccess cA = new ComponentAccess(annotatedObject);

        // parameters
        sb.append("<h2>Parameters</h2>").append(NEWLINE);
        sb.append(NEWLINE);
        sb.append("<blockquote>");
        // parameters: fields
        Collection<Access> inputs = cA.inputs();
        StringBuilder sbTmp = new StringBuilder();
        collectParameters(sbTmp, inputs);
        toTable(sb, sbTmp, "Input parameters");
        sb.append(NEWLINE);
        Collection<Access> outputs = cA.outputs();
        sbTmp = new StringBuilder();
        collectParameters(sbTmp, outputs);
        toTable(sb, sbTmp, "Output parameters");
        sb.append("</blockquote>");
        sb.append(NEWLINE);
View Full Code Here


                    OmsBoxUtils.generateModuleDocumentation(className);
                } catch (Throwable e) {
                    // ignore module
                    continue;
                }
                ComponentAccess cA = new ComponentAccess(newInstance);

                Collection<Access> inputs = cA.inputs();
                for( Access access : inputs ) {
                    addInput(access, module);
                }

                Collection<Access> outputs = cA.outputs();
                for( Access access : outputs ) {
                    addOutput(access, module);
                }

                if (categoryStr.equals(OmsBoxConstants.GRIDGEOMETRYREADER)) {
View Full Code Here

            sb.append(" Name to use in a script: <b>" + nameStr + "</b>").append(NEWLINE);
            sb.append("</blockquote>");
            sb.append(NEWLINE);
        }
        // general info: authors
        Author author = moduleClass.getAnnotation(Author.class);
        if (author != null) {
            String authorNameStr = author.name();
            String[] authorNameSplit = authorNameStr.split(",");

            String authorContactStr = author.contact();
            String[] authorContactSplit = authorContactStr.split(",");

            sb.append("<blockquote>");
            sb.append(" Authors ").append(NEWLINE);
            sb.append(HTMLNEWLINE);
View Full Code Here

            sb.append("</blockquote>");
            sb.append(NEWLINE);
            sb.append(NEWLINE);
        } else {
            // try with module description
            Description description = moduleClass.getAnnotation(Description.class);
            String descriptionStr = AnnotationUtilities.getLocalizedDescription(description);
            if (description != null) {
                sb.append("<h2>Description</h2>").append(NEWLINE);
                sb.append(NEWLINE);
                sb.append("<blockquote>");
View Full Code Here

    private static void collectParameters( StringBuilder sbTmp, Collection<Access> accessList ) throws Exception {
        for( Access access : accessList ) {
            Field field = access.getField();
            String fieldName = field.getName();
            Description descriptionAnnot = field.getAnnotation(Description.class);

            if (fieldName.equals("pm")) {
                // ignore progress monitor
                continue;
            }
View Full Code Here

                }
                if (moduleClass.getName().endsWith("Buffer")) {
                    System.out.println();
                }
               
                Description description = moduleClass.getAnnotation(Description.class);
                String descrStr = null;
                if (description != null) {
                    descrStr = description.value();
                }
                Status status = moduleClass.getAnnotation(Status.class);

                ModuleDescription module = new ModuleDescription(moduleClass, categoryStr, descrStr, status);
View Full Code Here

        long t4 = System.currentTimeMillis();
        System.out.println((t4 - t3) / 1000);
    }
    private void addInput( Access access, ModuleDescription module ) throws Exception {
        Field field = access.getField();
        Description descriptionAnn = field.getAnnotation(Description.class);
        String descriptionStr = "No description available";
        if (descriptionAnn != null) {
            descriptionStr = AnnotationUtilities.getLocalizedDescription(descriptionAnn);
        }
View Full Code Here

        module.addInput(fieldName, fieldClass.getCanonicalName(), descriptionStr, defaultValue, uiHint);
    }

    private void addOutput( Access access, ModuleDescription module ) throws Exception {
        Field field = access.getField();
        Description descriptionAnn = field.getAnnotation(Description.class);
        String descriptionStr = "No description available";
        if (descriptionAnn != null) {
            descriptionStr = AnnotationUtilities.getLocalizedDescription(descriptionAnn);
        }
        StringBuilder sb = new StringBuilder();
View Full Code Here

        StringBuilder sb = new StringBuilder();
        sb.append("<html><body>\n");

        // modules documentation
        Documentation documentation = moduleClass.getAnnotation(Documentation.class);
        String documentationStr = null;
        if (documentation != null) {
            documentationStr = AnnotationUtilities.getLocalizedDocumentation(documentation);
            if (documentationStr.length() == 0) {
                documentationStr = null;
View Full Code Here

            sb.append(" License: " + licenseStr).append(NEWLINE);
            sb.append("</blockquote>");
            sb.append(NEWLINE);
        }
        // general info: keywords
        Keywords keywords = moduleClass.getAnnotation(Keywords.class);
        if (keywords != null) {
            String keywordsStr = AnnotationUtilities.getLocalizedKeywords(keywords);
            sb.append("<blockquote>");
            sb.append(" Keywords: " + keywordsStr).append(NEWLINE);
            sb.append("</blockquote>");
View Full Code Here

TOP

Related Classes of oms3.annotations.Documentation

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.